/**
 * TripleT Order Report System - Modern Styles
 * 现代化样式设计 - 支持响应式布局
 */

:root {
    --primary-color: #4A90B8;
    --primary-dark: #3a7aa0;
    --secondary-color: #5a9bc0;
    --success-color: #4CAF50;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #2c3e50;
    --text-color: #333;
    --text-muted: #6c757d;
    --border-color: #e0e0e0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 8px rgba(0,0,0,0.1);
    --shadow-xl: 0 8px 16px rgba(0,0,0,0.12);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;
    --border-radius-sm: 3px;
    --border-radius-md: 4px;
    --border-radius-lg: 6px;
    --border-radius-xl: 8px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.5;
    color: var(--text-color);
    margin: 0;
    padding: 0;
    background: #f5f5f5;
    min-height: 100vh;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 0 5px;
    }
    
    .container {
        padding: 10px;
    }
    
    .header-container {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        text-align: left;
        padding: 0 12px;
    }
    
    header {
        padding: 8px 0;
    }
    
    /* 标题缩小 */
    .header-container h1 {
        font-size: 14px;
        white-space: nowrap;
        margin: 0;
    }
    
    /* 隐藏不必要的元素 */
    .header-user-name { display: none; }
    .user-role-badge { display: none; }
    .cp-trigger-text { display: none; }
    .cp-trigger-kbd { display: none; }
    
    /* Command Palette 按钮变为纯图标 */
    .cp-trigger-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        padding: 0;
        justify-content: center;
        margin: 0;
        box-sizing: border-box;
        border: 1px solid rgba(255, 255, 255, 0.15);
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-group {
        width: 100%;
        min-width: unset;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-card {
        padding: 10px;
    }
    
    .stat-value {
        font-size: 1em;
    }
    
    .stat-label {
        font-size: 0.7em;
    }
    
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 8px;
    }
    
    .order-items {
        padding: 10px;
    }
    
    .style-table {
        font-size: 11px;
    }
    
    .style-table th,
    .style-table td {
        padding: 6px;
    }
    
    .pagination-controls {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .login-container {
        padding: 30px 20px;
        max-width: 90%;
    }
    
    .logo-image {
        width: 200px;
    }
    
    .login-container h1 {
        font-size: 1.5em;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-tab {
        flex: 1;
        text-align: center;
        margin-right: 2px;
    }
    
    .header-container h1 {
        font-size: 13px;
    }
    
    .header-logout {
        gap: 4px;
    }
    
    .header-icon-link {
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
        font-size: 12px;
    }
    
    /* 超小屏幕隐藏次要图标 */
    .header-icon-link[title="Change Password"] {
        display: none;
    }
    
    .cp-trigger-btn {
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
        font-size: 12px;
    }
    
    h1 {
        font-size: 1em;
    }
    
    .section-title {
        font-size: 1.1em;
    }
    
    .order-items h3 {
        font-size: 1em;
    }
    
    .pagination-controls {
        font-size: 12px;
    }
    
    .pagination-link {
        padding: 3px 8px;
    }
}
/* Header Styles - Refined */
header {
    background: linear-gradient(to right, #2c3e50, #34495e);
    color: white;
    padding: 12px 25px;
    border-bottom: 1px solid #1a252f;
    margin-bottom: 20px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
    box-sizing: border-box;
}

header h1 {
    margin: 0;
    font-size: 1.4em;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

h1 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.container {
    background: white;
    padding: 25px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin: 0 auto 25px;
    max-width: 1600px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
/* Message Styles */
.message {
    padding: 15px 20px;
    border-radius: var(--border-radius-md);
    margin-bottom: 20px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.message::before {
    font-size: 1.2em;
}

.message-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #a8d5ba;
}

.message-success::before {
    content: '✓';
}

.message-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #e8b4b9;
}

.message-error::before {
    content: '✕';
}

.message-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border: 1px solid #ffd93d;
}

.message-warning::before {
    content: '⚠';
}

.message-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border: 1px solid #98d4e0;
}

.message-info::before {
    content: 'ℹ';
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Filter Styles - Refined */
.filters {
    background: linear-gradient(to bottom, #fafbfc, #f5f6f7);
    padding: 16px 20px;
    border: 1px solid #e0e0e0;
    border-bottom: 2px solid #4A90B8;
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.form-group {
    flex: 1;
    min-width: 200px;
    margin: 0;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #555;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

input[type="text"],
input[type="date"],
input[type="password"],
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
    height: 38px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(to bottom, #ffffff, #fafafa);
    color: #444;
    position: relative;
}

.custom-single-select {
    position: relative;
    width: 100%;
}

.custom-single-select-toggle {
    width: 100%;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    box-sizing: border-box;
    background: linear-gradient(to bottom, #ffffff, #fafafa);
    color: #444;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-single-select-toggle:hover {
    border-color: #4A90B8;
    box-shadow: 0 2px 6px rgba(74, 144, 184, 0.08);
}

.custom-single-select-toggle:focus {
    outline: none;
    border-color: #4A90B8;
    box-shadow: 0 0 0 3px rgba(74, 144, 184, 0.15), 0 2px 8px rgba(74, 144, 184, 0.1);
    background: #ffffff;
}

.custom-single-select.is-disabled .custom-single-select-toggle {
    opacity: 0.65;
    cursor: not-allowed;
    background: #f3f4f6;
    box-shadow: none;
}

.custom-single-select-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
    font-size: 13px;
}

.custom-single-select-arrow {
    flex-shrink: 0;
    font-size: 10px;
    color: #666;
    transition: transform 0.2s ease;
}

.custom-single-select.open .custom-single-select-arrow {
    transform: rotate(180deg);
}

.custom-single-select-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    display: none;
    max-height: 240px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    z-index: 200;
    padding: 6px;
}

.custom-single-select.open .custom-single-select-menu {
    display: block;
}

.custom-single-select-option {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #444;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.custom-single-select-option:hover {
    background: #f5f9fc;
}

.custom-single-select-option.selected {
    background: #eaf4fb;
    color: #245b7e;
    font-weight: 600;
}

.custom-single-select-native {
    display: none !important;
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="password"]:focus,
select:focus {
    outline: none;
    border-color: #4A90B8;
    box-shadow: 0 0 0 3px rgba(74, 144, 184, 0.15), 0 2px 8px rgba(74, 144, 184, 0.1);
    background: #ffffff;
    transform: translateY(-1px);
}

input[type="text"]:hover,
input[type="date"]:hover,
select:hover {
    border-color: #4A90B8;
    box-shadow: 0 2px 6px rgba(74, 144, 184, 0.08);
}

/* 输入框内容变化时的过渡效果 */
input[type="text"],
select {
    animation: inputFadeIn 0.3s ease;
}

@keyframes inputFadeIn {
    from {
        opacity: 0.7;
    }
    to {
        opacity: 1;
    }
}
/* Button Styles - Refined & Polished with Animations */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    height: 36px;
    box-sizing: border-box;
    vertical-align: middle;
    margin: 0;
    background: linear-gradient(to bottom, #ffffff, #f5f5f5);
    color: #444;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

/* 按钮涟漪效果 */
.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.btn:active::after {
    width: 200px;
    height: 200px;
}

.btn:hover {
    background: linear-gradient(to bottom, #f8f8f8, #e8e8e8);
    border-color: #c0c0c0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.btn:active {
    background: #e0e0e0;
    transform: translateY(0);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.1s ease;
}

/* 按钮点击时的缩放动画 */
.btn-clicked {
    animation: btnClick 0.3s ease;
}

@keyframes btnClick {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

.btn-primary {
    background: linear-gradient(to bottom, #4A90B8, #3a7aa0);
    color: white;
    border-color: #3a7aa0;
}

.btn-primary:hover {
    background: linear-gradient(to bottom, #3a7aa0, #2d6a8a);
    border-color: #2d6a8a;
}

.btn-secondary {
    background: linear-gradient(to bottom, #ffffff, #f5f5f5);
    color: #555;
    border-color: #d0d0d0;
}

.btn-secondary:hover {
    background: linear-gradient(to bottom, #f8f8f8, #e8e8e8);
    border-color: #c0c0c0;
}

.btn-success {
    background: linear-gradient(to bottom, #5cb85c, #4cae4c);
    color: white;
    border-color: #4cae4c;
}

.btn-success:hover {
    background: linear-gradient(to bottom, #4cae4c, #449d44);
}

.btn-danger {
    background: linear-gradient(to bottom, #d9534f, #c9302c);
    color: white;
    border-color: #c9302c;
}

.btn-danger:hover {
    background: linear-gradient(to bottom, #c9302c, #ac2925);
}

.btn-warning {
    background: linear-gradient(to bottom, #f0ad4e, #ec971f);
    color: white;
    border-color: #ec971f;
}

.btn-warning:hover {
    background: linear-gradient(to bottom, #ec971f, #d58512);
}

.btn-info {
    background: linear-gradient(to bottom, #5bc0de, #46b8da);
    color: white;
    border-color: #46b8da;
}

.btn-info:hover {
    background: linear-gradient(to bottom, #46b8da, #31b0d5);
}

/* Outline button — white background, themed border/text; signals
   "clickable→may open a menu" without competing with primary actions. */
.btn-outline {
    background: #fff;
    color: #3a7aa0;
    border-color: #c8d6e0;
}
.btn-outline:hover {
    background: #f1f7fb;
    border-color: #4A90B8;
    color: #2d6a8a;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    height: 32px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    height: 50px;
}
/* Stats Grid Styles - Refined with Animations */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
    animation: statsSlideIn 0.5s ease-out;
}

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

.stat-card {
    background: linear-gradient(to bottom, #ffffff, #f8f9fa);
    color: #333;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: statCardPop 0.4s ease-out backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

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

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, #4A90B8, #5a9bc0);
}

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

.stat-value {
    font-size: 1.8em;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.2;
    color: #4A90B8;
    letter-spacing: -0.5px;
}

.stat-label {
    font-size: 12px;
    color: #666;
    margin: 0;
    line-height: 1.2;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.stat-card.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Statistics Comparison Layout - Sales Analysis */
.stats-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 25px;
    animation: statsSlideIn 0.5s ease-out;
}

.stats-year-section {
    background: linear-gradient(to bottom, #ffffff, #f8f9fa);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}

.stats-year-section:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.stats-year-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

.stats-year-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 12px;
    border-radius: 20px;
    color: white;
}

.stats-year-badge.last-year {
    background: linear-gradient(135deg, #6c757d, #868e96);
}

.stats-year-badge.this-year {
    background: linear-gradient(135deg, #4A90B8, #5a9bc0);
}

.stats-year-value {
    font-size: 1.4em;
    font-weight: 700;
    color: #333;
}

.stats-year-section .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 0;
}

.stats-year-section .stat-card {
    padding: 15px 10px;
}

.stats-year-section .stat-value {
    font-size: 1.3em;
}

.stats-year-section .stat-label {
    font-size: 11px;
}

/* Responsive design for statistics comparison */
@media (max-width: 768px) {
    .stats-comparison {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .stats-year-section .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
/* Table Styles - Refined & Polished with Animations */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 13px;
    background: white;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    animation: tableFadeIn 0.5s ease-out;
}

/* 表格数据更新时的淡入动画 */
@keyframes tableFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 表格行依次出现的动画效果 */
tbody tr {
    animation: rowSlideIn 0.3s ease-out backwards;
}

tbody tr:nth-child(1) { animation-delay: 0.05s; }
tbody tr:nth-child(2) { animation-delay: 0.1s; }
tbody tr:nth-child(3) { animation-delay: 0.15s; }
tbody tr:nth-child(4) { animation-delay: 0.2s; }
tbody tr:nth-child(5) { animation-delay: 0.25s; }
tbody tr:nth-child(6) { animation-delay: 0.3s; }
tbody tr:nth-child(7) { animation-delay: 0.35s; }
tbody tr:nth-child(8) { animation-delay: 0.4s; }
tbody tr:nth-child(9) { animation-delay: 0.45s; }
tbody tr:nth-child(10) { animation-delay: 0.5s; }

@keyframes rowSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

th, td {
    padding: 12px 14px;
    text-align: left;
    border: 1px solid #e8e8e8;
}

th {
    background: linear-gradient(to bottom, #f8f8f8, #f0f0f0);
    font-weight: 600;
    color: #444;
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 12px;
    border-bottom: 2px solid #d0d0d0;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    text-shadow: 0 1px 0 rgba(255,255,255,0.8);
    text-align: center;
}

td {
    color: #555;
    /* font-weight: 400; */
    text-align: center;
    line-height: 1.5;
}

tr {
    transition: background 0.3s ease;
    background-color: white;
}

/* Zebra striping for better readability */
tr:nth-child(even) {
    background-color: #f0f4f8;
}

/* Row hover with gradient - must be after zebra striping */
tr:hover {
    background: linear-gradient(to right, #d0e8f5, #e0f0f8 40%, #e8f5fa);
}

tr:nth-child(even):hover {
    background: linear-gradient(to right, #c8e0f0, #d8e8f0 40%, #e0f0f5);
}

/* Subtle row separator using border */
tbody tr {
    border-bottom: 1px solid #eaeaea;
}

tbody tr:last-child {
    border-bottom: none;
}

/* Total/Summary Row (Green style like the example) */
tr.total-row,
tr.summary-row {
    background-color: #4CAF50 !important;
}

tr.total-row td,
tr.summary-row td {
    background-color: #4CAF50;
    color: white;
    font-weight: 600;
    border-color: #45a049;
}
.data-table {
    overflow-x: auto;
    overflow-y: auto;
}

/* Batch Actions Bar */
/* ── Table Issue Indicator Blocks ── */
.defect-col-head {
    width: 28px;
    text-align: center;
}
.defect-indicator-col {
    padding: 6px 0 !important;
    vertical-align: middle;
}
.defect-blocks {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.defect-block {
    display: inline-block;
    width: 20px;
    height: 12px;
    border-radius: 3px;
    font-size: 0.55rem;
    font-weight: 700;
    line-height: 12px;
    text-align: center;
    color: #fff;
    cursor: default;
}
.defect-block.critical { background: #ef4444; }
.defect-block.major    { background: #f59e0b; }
.defect-block.minor    { background: #3b82f6; }

/* ── Detail Panel Info Card ── */
.detail-info-card {
    margin: 0 20px 12px;
    padding: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.detail-info-card .info-card-spinner {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}
.detail-info-card .info-card-content {
    display: flex;
    flex-direction: column;
}
.detail-info-card .info-row {
    display: flex;
    gap: 16px;
    padding: 10px 16px;
}
.detail-info-card .info-row + .info-row {
    border-top: 1px solid #f1f5f9;
}
.detail-info-card .info-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.detail-info-card .info-item.info-full {
    flex: none;
    width: 100%;
}
.detail-info-card .info-label {
    font-size: 0.65rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
}
.detail-info-card .info-value {
    font-size: 0.9em;
    font-weight: 600;
    color: #1e293b;
}
.detail-info-card .info-passed { color: #10b981; font-weight: 700; }
.detail-info-card .info-failed { color: #ef4444; font-weight: 700; }
.detail-info-card .status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 600;
}

/* ── Info card quantity row: horizontal stat bars ── */
.detail-info-card .info-row.info-stats-row {
    background: #f8fafc;
    padding: 12px 16px;
    gap: 0;
}
.detail-info-card .info-stats-row .info-item {
    flex: 1;
    align-items: center;
    text-align: center;
    border-right: 1px solid #e2e8f0;
    padding: 0 12px;
}
.detail-info-card .info-stats-row .info-item:last-child {
    border-right: none;
}
.detail-info-card .info-stats-row .info-value {
    font-size: 1.15em;
    font-weight: 700;
}

.batch-actions-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
}

/* Table Sticky Header - Global Style */
.table-container {
    position: relative;
}

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

.table-container thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f8f9fa;
}

.table-container thead th {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.amount {
    font-weight: 600;
    color: #28a745;
}

/* Table cell alignment for numeric columns */
td:nth-child(4),
td:nth-child(5),
td:nth-child(6),
td:nth-child(7) {
    text-align: right;
}

th:nth-child(4),
th:nth-child(5),
th:nth-child(6),
th:nth-child(7) {
    text-align: right;
}

/* Action column center alignment */
td:last-child,
th:last-child {
    text-align: center;
}

.no-data {
    text-align: center;
    padding: 50px;
    color: #666;
    font-style: italic;
}
.section-title {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.3em;
}
.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}
.order-row {
    cursor: pointer;
    transition: background-color 0.3s;
}
.order-row:hover {
    background-color: #e3e7ff !important;
}
.order-details {
    display: none;
    background-color: #f9f9f9;
}
.order-items {
    padding: 20px;
}
.order-items h3 {
    margin-bottom: 15px;
    color: #667eea;
}
.style-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    border: 1px solid #ddd;
}
.style-table th {
    background-color: #f1f3ff;
    padding: 10px;
    text-align: center;
    border: 1px solid #ddd;
}
.style-table td {
    padding: 10px;
    border: 1px solid #eee;
    text-align: center;
}
.style-table tr:hover {
    background-color: #f5f5f5;
}
/* ── Nav Switcher (Business Operations / Employee Services) ── */
.nav-switcher {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.nav-switch-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    height: 36px;
    box-sizing: border-box;
    border: 1px solid #d5dce3;
    border-radius: 8px;
    background: #fff;
    color: #5a6d80;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    line-height: 1;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.nav-switch-tab i {
    font-size: 13px;
    line-height: 1;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-switch-tab:hover {
    color: #3a7aa0;
    border-color: #b8ccdc;
    background: #f7fafc;
    box-shadow: 0 2px 6px rgba(74, 144, 184, 0.12);
}

.nav-switch-tab.active {
    background: linear-gradient(135deg, #4A90B8 0%, #3a7ca5 100%);
    color: #fff;
    border-color: #3a7ca5;
    box-shadow: 0 2px 8px rgba(74, 144, 184, 0.3);
}

.nav-switch-tab.active i {
    opacity: 1;
}

/* Nav group — display:contents lets children participate in parent flex */
.nav-group {
    display: contents;
}

/* Empty hint inside Employee Services nav-group */
.nav-empty-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 28px 20px;
    color: #8a94a0;
    font-size: 14px;
    font-style: italic;
    width: 100%;
}

.nav-empty-hint i {
    font-size: 20px;
    opacity: 0.6;
}

/* Navigation Tabs - Refined Style */
.nav-tabs {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #dee2e6;
    gap: 6px;
}

.nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    text-decoration: none;
    color: #6c757d;
    background-color: white;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    font-size: 12px;
    transition: all 0.25s ease;
    min-width: 100px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.nav-tab .nav-icon {
    font-size: 22px;
    margin-bottom: 6px;
    transition: transform 0.2s ease;
}

.nav-tab .nav-label {
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.nav-tab.active {
    background: linear-gradient(135deg, #4A90B8 0%, #3a7ca5 100%);
    color: white;
    border-color: #4A90B8;
    box-shadow: 0 4px 12px rgba(74, 144, 184, 0.35);
    transform: translateY(-1px);
}

.nav-tab:hover {
    color: #4A90B8;
    background-color: white;
    border-color: #c5d9e8;
    box-shadow: 0 3px 8px rgba(74, 144, 184, 0.15);
    transform: translateY(-1px);
}

.nav-tab:hover .nav-icon {
    transform: scale(1.1);
}

.nav-tab.active:hover {
    color: white;
    background: linear-gradient(135deg, #4A90B8 0%, #3a7ca5 100%);
    border-color: #4A90B8;
}

.nav-tab.active .nav-icon {
    transform: scale(1.05);
}

/* Navigation Dropdown */
.nav-tab-dropdown {
    position: relative;
    display: inline-block;
}

.nav-tab-dropdown {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.nav-tab-dropdown .nav-tab {
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    min-width: 100px;
    min-height: 74px; /* 保持与其他按钮高度一致 */
    box-sizing: border-box;
}

.nav-tab-dropdown .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    min-width: 200px;
    z-index: 1000;
    padding: 8px 0;
    margin-top: 0;
    border: 1px solid #e8e8e8;
}

/* 悬停显示下拉菜单 - 鼠标移出整个dropdown区域才隐藏 */
.nav-tab-dropdown:hover .dropdown-menu {
    display: block;
}

/* 使用伪元素填补按钮和菜单之间的间隙，确保鼠标移动时不会中断 */
.nav-tab-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 10px;
    background: transparent;
    display: none;
}

.nav-tab-dropdown:hover::after {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #555;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.dropdown-item:hover {
    background: #f8f9ff;
    color: #667eea;
    border-left-color: #667eea;
}

.dropdown-item.active {
    background: #f0f4ff;
    color: #667eea;
    border-left-color: #667eea;
    font-weight: 500;
}

.dropdown-icon {
    font-size: 16px;
}

/* Loading Animation Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    display: flex;
    opacity: 1;
}

.loading-spinner {
    border: 4px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    border-top: 4px solid #667eea;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

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

.loading-content {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.loading-message {
    text-align: center;
    margin-top: 20px;
    color: #667eea;
    font-weight: 600;
    font-size: 16px;
}

/* ============================================
   Login Page — Modern Redesign
   ============================================ */

.login-page {
    background: linear-gradient(160deg, #141e2b 0%, #1e2d3d 40%, #2a3f54 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* 背景光晕装饰 */
.login-page::before,
.login-page::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    pointer-events: none;
    animation: floatGlow 8s ease-in-out infinite;
}

.login-page::before {
    width: 400px;
    height: 400px;
    background: var(--primary-color);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.login-page::after {
    width: 300px;
    height: 300px;
    background: #5a9bc0;
    bottom: -80px;
    left: -80px;
    animation-delay: -4s;
}

@keyframes floatGlow {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, -20px) scale(1.1); }
}

/* 登录页头部 */
.login-page-header {
    text-align: center;
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
    animation: fadeInDown 0.6s ease-out;
}

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

.login-page-header h1 {
    color: #fff;
    font-size: 1.7em;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
    margin: 0 0 6px 0;
}

.login-page-header p {
    color: rgba(255,255,255,0.5);
    font-size: 0.9em;
    font-weight: 400;
    letter-spacing: 0.3px;
}

/* 登录卡片 */
.login-container {
    background: rgba(255, 255, 255, 0.97);
    padding: 36px 32px;
    border-radius: 16px;
    box-shadow:
        0 1px 2px rgba(0,0,0,0.05),
        0 4px 8px rgba(0,0,0,0.08),
        0 12px 24px rgba(0,0,0,0.12),
        0 24px 48px rgba(0,0,0,0.16);
    width: 100%;
    max-width: 400px;
    border: 1px solid rgba(255,255,255,0.6);
    position: relative;
    z-index: 1;
    animation: cardEnter 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: 0.1s;
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    backdrop-filter: blur(10px);
}

@keyframes cardEnter {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 顶部装饰线 */
.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    border-radius: 0 0 2px 2px;
}

.login-logo {
    text-align: center;
    margin-bottom: 24px;
    animation: fadeIn 0.5s ease-out 0.3s both;
}

.logo-image {
    width: 240px;
    height: auto;
    border-radius: var(--border-radius-lg);
    object-fit: contain;
    opacity: 0.95;
    transition: opacity 0.3s ease;
}

.logo-image:hover {
    opacity: 1;
}

/* 登录页消息提示 */
.login-container .message {
    margin-bottom: 20px;
    padding: 12px 14px 12px 42px;
    border-radius: 10px;
    font-size: 0.88em;
    font-weight: 500;
    line-height: 1.5;
    position: relative;
    animation: messageSlideIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: 0.4s;
    border: 1px solid transparent;
}

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

.login-container .message.error {
    background: linear-gradient(135deg, #fdf2f2 0%, #fef2f2 100%);
    color: #991b1b;
    border-color: #fecaca;
}

.login-container .message.error::before {
    content: '\f057';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1em;
}

.login-container .message.warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fefce8 100%);
    color: #92400e;
    border-color: #fde68a;
}

.login-container .message.warning::before {
    content: '\f071';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1em;
}

.login-container .message.info {
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
    color: #1e40af;
    border-color: #bfdbfe;
}

.login-container .message.info::before {
    content: '\f05a';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1em;
}

.login-container .message.success {
    background: linear-gradient(135deg, #f0fdf4 0%, #f0fdf4 100%);
    color: #166534;
    border-color: #bbf7d0;
}

.login-container .message.success::before {
    content: '\f058';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1em;
}

/* 表单 */
.login-container .form-group {
    margin-bottom: 16px;
    position: relative;
    animation: fadeInUp 0.4s ease-out both;
}

.login-container .form-group:nth-child(1) { animation-delay: 0.45s; }
.login-container .form-group:nth-child(2) { animation-delay: 0.55s; }

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

.login-container label {
    display: block;
    margin-bottom: 6px;
    color: #4a5568;
    font-weight: 600;
    font-size: 0.82em;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

/* 带图标的输入框容器 */
.login-input-wrap {
    position: relative;
}

.login-input-wrap i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 0.95em;
    transition: color 0.25s ease;
    pointer-events: none;
}

.login-container input[type="text"],
.login-container input[type="password"] {
    width: 100%;
    padding: 11px 12px 11px 38px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #f8fafc;
    color: #2d3748;
    height: 44px;
}

.login-container input[type="text"]::placeholder,
.login-container input[type="password"]::placeholder {
    color: #a0aec0;
    font-size: 13px;
}

.login-container input[type="text"]:hover,
.login-container input[type="password"]:hover {
    border-color: #cbd5e0;
    background-color: #fff;
}

.login-container input[type="text"]:focus,
.login-container input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(74, 144, 184, 0.1), 0 2px 8px rgba(74, 144, 184, 0.08);
}

.login-container input[type="text"]:focus + i,
.login-container input[type="password"]:focus + i,
.login-input-wrap:focus-within i {
    color: var(--primary-color);
}

/* 登录按钮 */
.login-container .btn-primary {
    width: 100%;
    padding: 12px;
    margin-top: 6px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.4px;
    position: relative;
    overflow: hidden;
    height: 46px;
    animation: fadeInUp 0.4s ease-out 0.65s both;
}

.login-container .btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.login-container .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 144, 184, 0.4);
}

.login-container .btn-primary:hover::after {
    left: 100%;
}

.login-container .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(74, 144, 184, 0.3);
}

.login-container .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 登录页底部 */
.login-footer {
    text-align: center;
    padding: 16px;
    color: rgba(255,255,255,0.35);
    font-size: 0.78em;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1;
    letter-spacing: 0.3px;
}

.login-footer > div + div {
    margin-top: 3px;
}

/* Customer Orders Styles */
.product-row {
    cursor: pointer;
    transition: background-color 0.3s;
}

.product-row:hover {
    background-color: #e3e7ff !important;
}

.customer-details {
    background-color: #f5f5f5;
}

.customer-orders-container {
    padding: 15px;
    background-color: #f5f5f5;
    border: 1px solid var(--border-color);
}

.customer-orders-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 10px 15px;
    background: linear-gradient(to right, #f8f9fa, #f0f2f5);
    color: #444;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #4A90B8;
    border-radius: 0 4px 4px 0;
}

.customer-orders-header h4 {
    margin: 0;
    color: #444;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.loading-indicator {
    color: var(--primary-color);
    font-style: italic;
    font-size: 14px;
}

.customer-orders-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    background-color: white;
    border: none;
}

.customer-orders-table th {
    background: #f0f0f0;
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    color: #333;
    font-size: 12px;
    border: 1px solid #e0e0e0;
    border-bottom: 2px solid #ccc;
    text-transform: uppercase;
}

.customer-orders-table td {
    padding: 8px 10px;
    border: 1px solid #e0e0e0;
    color: #555;
    font-size: 12px;
}

.customer-orders-table tr {
    transition: background 0.3s ease;
    background-color: white;
}

.customer-orders-table tr:hover {
    background: linear-gradient(to right, #d0e8f5, #e0f0f8 40%, #e8f5fa);
}

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

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 1000px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

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

.modal-header h4 {
    margin: 0;
    color: #333;
}

.modal .close {
    background: none;
    border: none;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    padding: 0;
    margin: 0;
}

.modal .close:hover {
    color: #000;
}

.modal-loading {
    text-align: center;
    padding: 20px;
    display: none;
}

.modal-loading-text {
    margin-top: 10px;
}

.modal-error {
    text-align: center;
    padding: 20px;
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    display: none;
}

.modal-content-area {
    display: none;
}

/* Order Details Table Styles - Minimal */
.order-details-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: white;
    border: none;
}

.order-details-table th {
    background: #f0f0f0;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    font-size: 12px;
    border: 1px solid #e0e0e0;
    border-bottom: 2px solid #ccc;
    text-transform: uppercase;
}

.order-details-table td {
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    text-align: left;
    color: #555;
    font-size: 13px;
}

.order-details-table tr {
    transition: background 0.3s ease;
    background-color: white;
}

.order-details-table tr:hover {
    background: linear-gradient(to right, #d0e8f5, #e0f0f8 40%, #e8f5fa);
}

.order-details-table th:nth-child(4),
.order-details-table th:nth-child(5),
.order-details-table th:nth-child(6),
.order-details-table td:nth-child(4),
.order-details-table td:nth-child(5),
.order-details-table td:nth-child(6) {
    text-align: right;
}

/* Header Styles */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 auto;
    padding: 0 15px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.header-logout {
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logout a {
    color: white;
    text-decoration: none;
    margin: 0;
}

/* Header icon-only navigation links */
.header-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.75) !important;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    text-decoration: none !important;
    font-size: 15px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.header-icon-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.35);
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header-icon-link:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.22);
}

/* Header user info group */
.header-user-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 12px;
}

.header-user-name {
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.user-role-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.4px;
    line-height: 1.4;
    white-space: nowrap;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.user-role-badge.superadmin {
    background: rgba(212, 175, 55, 0.18);
    color: #f5d76e;
    border-color: rgba(212, 175, 55, 0.3);
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.25);
}

.user-role-badge.admin {
    background: rgba(74, 144, 226, 0.18);
    color: #7eb8f0;
    border-color: rgba(74, 144, 226, 0.3);
}

.user-role-badge.supervisor {
    background: rgba(142, 68, 173, 0.18);
    color: #c39bd3;
    border-color: rgba(142, 68, 173, 0.3);
}

.user-role-badge.smsn {
    background: rgba(22, 160, 133, 0.18);
    color: #76d7c4;
    border-color: rgba(22, 160, 133, 0.3);
}

.user-role-badge.user {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.18);
}

/* Cache Status Bar Styles */
.cache-status-bar {
    background: #f8f9fa;
    padding: 10px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cache-status-bar > div {
    display: flex;
    gap: 15px;
    align-items: center;
}

.cache-status-bar .btn-group {
    display: flex;
    gap: 10px;
}

#cache-status {
    font-weight: 500;
}

#cache-status .status-text {
    color: #6c757d;
}

#cache-status .status-text.cached {
    color: #28a745;
}

#cache-status .status-text.fresh {
    color: #28a745;
}

#cache-status .status-text.no-cache {
    color: #6c757d;
}

#cache-status .status-text.error {
    color: #dc3545;
}

#cache-status .status-text.refreshing {
    color: #007bff;
}

#last-sync {
    font-size: 0.9em;
    color: #6c757d;
}

.cache-status-bar .data-range-info {
    font-size: 0.9em;
    color: #495057;
    font-style: italic;
}

/* Chart Styles */
.chart-container {
    margin: 20px 0;
}

.chart-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
}

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

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.chart-legend-item {
    display: flex;
    align-items: center;
}

.chart-legend-color {
    width: 15px;
    height: 15px;
    margin-right: 5px;
}

/* Pagination Styles */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 15px auto;
    padding: 12px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #dee2e6;
    max-width: 600px;
    flex-wrap: nowrap;
}

.pagination-text {
    font-size: 13px;
    color: #495057;
    font-weight: 500;
    white-space: nowrap;
    margin-right: 10px;
}

.pagination-controls .btn {
    padding: 6px 12px;
    border: 1px solid #007bff;
    background: #fff;
    color: #007bff;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pagination-controls .btn:hover:not([disabled]) {
    background: #007bff;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0,123,255,0.3);
}

.pagination-controls .btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: #ccc;
    color: #999;
    background: #f5f5f5;
}

.pagination-link {
    margin: 0 2px;
    padding: 4px 10px;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #007bff;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
}

.pagination-link:hover {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.pagination-link.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.pagination-dots {
    margin: 0 5px;
}

.pagination-link {
    margin: 0 2px;
}

/* 响应式表格样式 */
@media (max-width: 768px) {
    .data-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
    
    .customer-orders-table {
        min-width: 500px;
    }
    
    .style-table {
        min-width: 450px;
    }
}

/* 移动端导航优化 */
@media (max-width: 768px) {
    /* Header must be declared AFTER base rules (line ~249/1905) to take effect.
       Negative margins counteract body's 5px padding so header is edge-to-edge. */
    header {
        padding: 8px 12px;
        margin-left: -5px;
        margin-right: -5px;
        width: auto;
    }

    .header-container {
        padding: 0;
    }

    .header-logout {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-end;
        align-items: center;
        gap: 6px;
        margin-left: auto;
    }
    
    .header-logout a {
        display: inline-flex;
    }

    .header-icon-link {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        padding: 0;
        font-size: 14px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        box-sizing: border-box;
    }

    .cp-trigger-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        padding: 0;
        font-size: 14px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        box-sizing: border-box;
        border: 1px solid rgba(255, 255, 255, 0.15);
    }

    .header-user-info {
        display: none;
    }

    .filters {
        margin-bottom: 15px;
    }
    
    .form-group label {
        font-size: 12px;
    }
    
    input[type="text"],
    input[type="date"],
    select {
        font-size: 12px;
        height: 32px;
    }
    
    .btn {
        height: 32px;
    }
    
    .stats-grid {
        margin-bottom: 15px;
    }
    
    .section-title {
        margin-bottom: 10px;
    }
    
    .order-items {
        margin-top: 10px;
    }
    
    .order-items h3 {
        margin-bottom: 10px;
    }
    
    .modal-content {
        padding: 15px;
    }
    
    .modal-header {
        margin-bottom: 15px;
    }
    
    .modal-header h4 {
        font-size: 1.1em;
    }
}

/* No Data Message */
.no-data-message {
    text-align: center;
    padding: 20px;
}

/* Sort Indicator */
.sort-indicator {
    font-size: 0.8em;
    margin-left: 5px;
}

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

/* Customer Orders Header in Sales Analysis */
.customer-orders-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white !important;
    padding: 16px 20px;
    margin: -15px -15px 20px -15px;
    border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.customer-orders-header h4 {
    margin: 0;
    color: white !important;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Who Ordered Button - Refined */
.who-ordered-btn {
    white-space: nowrap;
    background: linear-gradient(to bottom, #f8f8f8, #e8e8e8);
    border: 1px solid #ccc;
    color: #444;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 3px;
    transition: all 0.15s ease;
}

.who-ordered-btn:hover {
    background: linear-gradient(to bottom, #4A90B8, #3a7aa0);
    border-color: #3a7aa0;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(74, 144, 184, 0.3);
}

/* Order Number Button - Refined */
.order-number-btn {
    background: none;
    border: none;
    color: #4A90B8;
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    padding: 2px 6px;
    font-size: 13px;
    border-bottom: 1px dotted #4A90B8;
    transition: all 0.15s ease;
}

.order-number-btn:hover {
    color: #2d6a8a;
    border-bottom-style: solid;
    background: rgba(74, 144, 184, 0.05);
    border-radius: 2px;
}

/* Customer Details Row Animation */
.customer-details {
    animation: slideDown 0.3s ease;
}

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

/* View Tabs - For Inventory Page */
.view-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.view-tab {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-weight: 500;
    color: #777;
    transition: all 0.2s ease;
}

.view-tab.active {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

.view-tab:hover {
    color: var(--primary-color);
    background-color: rgba(74, 144, 184, 0.03);
}

.tab-content {
    display: none;
}

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

/* Warehouse Stats Section */
.warehouse-stats {
    margin-top: 30px;
}

.warehouse-stats h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.1em;
}

/* Remarks 标记样式 */
.remark-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.remark-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.remark-rush {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: #fff;
    border: 1px solid #bd2130;
    animation: pulse-rush 2s infinite;
}

.remark-fob {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: #fff;
    border: 1px solid #117a8b;
}

/* RUSH 标记脉冲动画 */
@keyframes pulse-rush {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(220, 53, 69, 0);
    }
}

/* 同时有 RUSH 和 FOB 时的间距 */
.remark-badge + .remark-badge {
    margin-left: 6px;
}

/* Track No. 运输中标记样式 */
.track-no-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #0077b6 0%, #00b4d8 100%);
    color: #fff;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 119, 182, 0.3);
    animation: ship-move 1.5s ease-in-out infinite;
    white-space: nowrap;
}

.track-no-empty {
    color: #adb5bd;
    font-style: italic;
}

/* 轮船前进动画 - 前仆后继、尽快送达 */
@keyframes ship-move {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-3px);
    }
    75% {
        transform: translateX(3px);
    }
}

.track-no-badge:hover {
    animation: none;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 119, 182, 0.4);
}

/* Navigation Submenu Styles */
.nav-tab-with-submenu {
    position: relative;
    display: flex;
}

.nav-tab-with-submenu .nav-tab {
    position: relative;
}

.nav-tab-with-submenu .nav-tab::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: currentColor;
    opacity: 0.4;
}

.submenu {
    display: none;
    position: absolute;
    top: calc(100% - 5px);
    left: 0;
    min-width: 180px;
    background: white;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    padding: 8px 0;
    margin-top: 4px;
    border: 1px solid var(--border-color);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.nav-tab-with-submenu:hover .submenu,
.nav-tab-with-submenu .submenu:hover {
    display: block;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.submenu-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color var(--transition-fast);
    font-size: 14px;
}

.submenu-item:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

.submenu-item.active {
    background-color: var(--primary-color);
    color: white;
}

.submenu-icon {
    margin-right: 10px;
    font-size: 1.1em;
}

.submenu-label {
    font-weight: 500;
}

/* Submenu arrow */
.submenu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 20px;
    width: 12px;
    height: 12px;
    background: white;
    border-left: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color);
    transform: rotate(45deg);
    z-index: -1;
}

/* ============================================
   Common Component Styles (Merged from inline)
   ============================================ */

/* Time Range Badge - used in multiple pages */
.time-range {
    font-size: 14px;
    font-weight: normal;
    color: var(--text-muted);
    margin-left: 10px;
}

.time-range::before {
    content: '(';
}

.time-range::after {
    content: ')';
}

/* Status Badge Styles - Order Tracking / Purchase Order */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-quote { background: #6c757d; color: #fff; }
.status-entered { background: #0d6efd; color: #fff; }
.status-processing { background: #198754; color: #fff; }
.status-shipped { background: #0dcaf0; color: #fff; }
.status-invoiced { background: #6f42c1; color: #fff; }
.status-paid { background: #212529; color: #fff; }
.status-closed, .status-canceled { background: #dc3545; color: #fff; }

/* Form Group Compact - for tight layouts */
.form-group-compact {
    flex: 0 0 auto !important;
    min-width: unset !important;
}

/* ============================================
   订单更新标记样式
   ============================================ */

.update-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(238, 90, 90, 0.4);
    animation: updateBadgePulse 2s ease-in-out infinite;
    white-space: nowrap;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

@keyframes updateBadgePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(238, 90, 90, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 3px 8px rgba(238, 90, 90, 0.6);
    }
}

/* 表格单元格内的相对定位 */
.order-row td {
    position: relative;
}

/* 更新标记的悬停效果 */
.update-badge:hover {
    animation: none;
    transform: scale(1.1);
    background: linear-gradient(135deg, #ee5a5a, #dc3545);
}

/* ============================================
   Ctrl+K 搜索高亮动画
   ============================================ */
.cp-search-highlight {
    animation: cpHighlightFlash 1.6s ease-out;
}

@keyframes cpHighlightFlash {
    0%   { background-color: #fff9c4; box-shadow: inset 0 0 0 2px #ffd54f; }
    60%  { background-color: #fff9c4; box-shadow: inset 0 0 0 2px #ffd54f; }
    100% { background-color: transparent; box-shadow: inset 0 0 0 0 transparent; }
}

/* ============================================
   Mobile Hamburger Menu
   ============================================ */

/* Hamburger button - hidden on desktop */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    gap: 5px;
    padding: 8px;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1001;
}

.mobile-menu-btn:hover {
    border-color: #4A90B8;
    box-shadow: 0 2px 8px rgba(74, 144, 184, 0.15);
}

.hamburger-line {
    display: block;
    width: 20px;
    height: 2px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* X shape when open */
.mobile-menu-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

/* Responsive: collapse nav to hamburger sidebar when tabs overflow */
@media (max-width: 1050px) {
    .mobile-menu-btn {
        display: flex;
        margin-right: 8px;
        margin-left: 0;
        background: rgba(255,255,255,0.15);
        border-color: rgba(255,255,255,0.3);
    }
    .mobile-menu-btn:hover {
        background: rgba(255,255,255,0.25);
        border-color: rgba(255,255,255,0.5);
    }
    .hamburger-line {
        background: white;
    }

    /* Nav switcher compact on tablet/mobile */
    .nav-switcher {
        gap: 4px;
        margin-bottom: 5px;
    }

    .nav-switch-tab {
        padding: 6px 12px;
        font-size: 12px;
        gap: 4px;
        border-radius: 6px;
        height: 30px;
        line-height: 1;
    }

    .nav-switch-tab i {
        font-size: 11px;
        line-height: 1;
    }

    /* Title hugs the hamburger button instead of being centered */
    .header-container {
        justify-content: flex-start;
    }

    .header-logout {
        margin-left: auto;
    }

    .nav-tabs {
        display: flex;
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        flex-direction: column;
        background: white;
        z-index: 1000;
        overflow-y: auto;
        padding: 60px 16px 20px;
        gap: 4px;
        margin-bottom: 0;
        border-radius: 0;
        border: none;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .nav-tabs.open {
        left: 0;
    }

    .nav-tab {
        flex-direction: row;
        justify-content: flex-start;
        padding: 12px 16px;
        min-width: unset;
        width: 100%;
        font-size: 14px;
        border-radius: 8px;
        box-shadow: none;
    }

    .nav-tab .nav-icon {
        font-size: 20px;
        margin-right: 12px;
        margin-bottom: 0;
    }

    .nav-tab .nav-label {
        white-space: normal;
    }

    .nav-tab.active {
        transform: none;
    }

    .nav-tab:hover {
        transform: none;
    }

    /* Submenu mobile overrides */
    .nav-tab-with-submenu {
        flex-direction: column;
        position: static;
    }

    .nav-tab-with-submenu .nav-tab::after {
        content: '\f078';
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        position: absolute;
        bottom: auto;
        left: auto;
        right: 16px;
        top: 50%;
        transform: translateY(-50%);
        width: auto;
        height: auto;
        border-radius: 0;
        background-color: transparent;
        opacity: 0.5;
        font-size: 10px;
        transition: transform 0.2s ease;
    }

    .nav-tab-with-submenu.expanded .nav-tab::after {
        transform: translateY(-50%) rotate(180deg);
    }

    .nav-tab-with-submenu .submenu {
        position: static;
        display: none;
        opacity: 1;
        transform: none;
        box-shadow: none;
        border: none;
        padding: 0 0 0 20px;
        margin: 0;
        min-width: unset;
        width: 100%;
        pointer-events: auto;
        background: transparent;
        z-index: auto;
    }

    .nav-tab-with-submenu .submenu::before {
        display: none;
    }

    .nav-tab-with-submenu.expanded .submenu {
        display: block;
    }

    /* Override desktop hover to not show submenu on mobile */
    .nav-tab-with-submenu:hover .submenu {
        display: none;
        opacity: 0;
        pointer-events: none;
    }

    .nav-tab-with-submenu.expanded:hover .submenu {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    .submenu-item {
        padding: 10px 16px;
        border-radius: 6px;
        font-size: 13px;
    }

    .submenu-item:hover {
        background-color: #f0f4ff;
    }
}