/* 押运管理系统 - 全局样式 */
:root {
    --primary: #283593;
    --primary-light: #3949ab;
    --primary-dark: #1a237e;
    --success: #2e7d32;
    --danger: #c62828;
    --warning: #e65100;
    --info: #0277bd;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #eeeeee;
    --gray-300: #e0e0e0;
    --gray-400: #bdbdbd;
    --gray-500: #9e9e9e;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;
    --sidebar-width: 260px;
    --sidebar-width-collapsed: 68px;
    --header-height: 64px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--gray-100);
    color: var(--gray-800);
    font-size: 14px;
    line-height: 1.6;
}

/* 布局 */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    transition: width 0.25s ease, transform 0.3s ease;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.sidebar-logo {
    font-size: 36px;
    margin-bottom: 5px;
}

.sidebar-title-row {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    width: 100%;
    min-height: 32px;
    margin-top: 4px;
}

.sidebar-title-spacer {
    display: none;
}

.sidebar-header h2 {
    min-width: 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 1px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

.sidebar::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track,
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb,
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.35);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.55);
}

.nav-section {
    margin-bottom: 8px;
    padding: 0 14px;
}

.nav-section-title {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 8px 14px 6px;
    font-weight: 700;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.78);
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
    font-size: 14px;
    gap: 11px;
    position: relative;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.nav-item.active {
    background: rgba(255,255,255,0.22);
    box-shadow: inset 3px 0 0 0 #64b5f6;
}

.nav-icon {
    width: 20px;
    text-align: center;
    font-size: 18px;
    flex-shrink: 0;
}

.nav-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.sidebar-copyright {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
    margin-bottom: 10px;
    line-height: 1.4;
    word-break: break-word;
}

.user-info-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius-sm);
    background: rgba(0,0,0,0.15);
}

.user-avatar-mini {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.3);
}

.user-name-mini {
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-role-mini {
    font-size: 11px;
    opacity: 0.7;
}

/* 主内容区 */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
    transition: margin-left 0.25s ease;
}

.top-header {
    height: var(--header-height);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    overflow: visible;
}

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

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-700);
    padding: 8px;
    border-radius: var(--radius-sm);
    line-height: 1;
    transition: background 0.2s ease;
}

.menu-toggle:hover {
    background: var(--gray-100);
}

.sidebar-collapse-btn {
    display: none;
}

/* 桌面端：默认窄条，.sidebar-expanded 时展开 */
@media (min-width: 769px) {
    .menu-toggle {
        display: block;
    }

    .sidebar {
        width: var(--sidebar-width-collapsed);
    }

    .main-wrapper {
        margin-left: var(--sidebar-width-collapsed);
    }

    .app-layout:not(.sidebar-expanded) .sidebar-header {
        padding: 18px 10px;
    }

    .app-layout:not(.sidebar-expanded) .sidebar-title-row {
        grid-template-columns: 1fr 28px;
        margin-top: 6px;
    }

    .app-layout:not(.sidebar-expanded) .sidebar-collapse-btn {
        grid-column: 2;
        justify-self: end;
    }

    .app-layout.sidebar-expanded .sidebar-title-row {
        grid-template-columns: 38px 1fr 28px;
        column-gap: 4px;
    }

    .app-layout.sidebar-expanded .sidebar-title-spacer {
        display: block;
        width: 38px;
        height: 28px;
    }

    .app-layout.sidebar-expanded .sidebar-header h2 {
        grid-column: 2;
        padding-left: 4px;
    }

    .app-layout.sidebar-expanded .sidebar-collapse-btn {
        grid-column: 3;
        justify-self: end;
    }

    .app-layout:not(.sidebar-expanded) .sidebar-header h2,
    .app-layout:not(.sidebar-expanded) .nav-section-title,
    .app-layout:not(.sidebar-expanded) .nav-text,
    .app-layout:not(.sidebar-expanded) .user-info-mini > div {
        display: none;
    }

    .app-layout:not(.sidebar-expanded) .nav-section {
        padding: 0 8px;
    }

    .app-layout:not(.sidebar-expanded) .nav-item {
        justify-content: center;
        padding: 11px 8px;
        gap: 0;
    }

    .app-layout:not(.sidebar-expanded) .user-info-mini {
        justify-content: center;
        padding: 10px 8px;
    }

    .app-layout:not(.sidebar-expanded) .sidebar-footer {
        padding: 12px 8px;
    }

    .app-layout:not(.sidebar-expanded) .sidebar-copyright {
        display: none;
    }

    .app-layout.sidebar-expanded .sidebar {
        width: var(--sidebar-width);
    }

    .app-layout.sidebar-expanded .main-wrapper {
        margin-left: var(--sidebar-width);
    }

    .sidebar-collapse-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        width: 28px;
        height: 28px;
        border: none;
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.15);
        color: #fff;
        font-size: 16px;
        line-height: 1;
        cursor: pointer;
        padding: 0;
    }

    .sidebar-collapse-btn:hover {
        background: rgba(255, 255, 255, 0.28);
    }
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--gray-500);
}

.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb span:last-child { color: var(--gray-800); font-weight: 500; }
.breadcrumb .sep { color: var(--gray-400); }

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    overflow: visible;
}

.header-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-600);
    position: relative;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    font-size: 19px;
}

.header-btn:hover { background: var(--gray-100); color: var(--primary); }

/* ── 顶栏消息铃铛下拉 ── */
.notify-dropdown { position: relative; }
.notify-bell-btn {
    font-size: 20px;
    line-height: 1;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.notify-bell-icon { display: block; line-height: 1; }
.notify-dropdown--open .notify-bell-btn,
.notify-dropdown.open .notify-bell-btn {
    background: #e8eaf6;
    color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(40, 53, 147, 0.15);
}
.notify-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: linear-gradient(135deg, #ef5350, #c62828);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(198, 40, 40, 0.35);
}
.notify-dropdown-menu {
    min-width: 340px;
    max-width: 380px;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 40px rgba(26, 35, 126, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 1200;
    animation: notifyPanelIn 0.2s ease-out;
}
.notify-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 14px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-left: 1px solid var(--gray-200);
    border-top: 1px solid var(--gray-200);
    transform: rotate(45deg);
}
@keyframes notifyPanelIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.notify-dropdown.open .notify-dropdown-menu {
    display: flex;
    flex-direction: column;
}
.notify-dropdown-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #f8f9ff 0%, #eef1fb 100%);
    border-bottom: 1px solid var(--gray-200);
}
.notify-dropdown-head-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.notify-dropdown-head-icon {
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
}
.notify-dropdown-title {
    display: block;
    font-size: 15px;
    color: var(--primary-dark);
    line-height: 1.3;
}
.notify-dropdown-sub {
    display: block;
    font-size: 12px;
    font-weight: normal;
    color: var(--gray-600);
    margin-top: 2px;
}
.notify-mark-all {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 4px 10px !important;
    font-size: 12px !important;
}
.notify-preview-list {
    max-height: 380px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #fff;
    scrollbar-width: thin;
}
.notify-preview-list::-webkit-scrollbar { width: 6px; }
.notify-preview-list::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}
.notify-preview-empty {
    padding: 32px 20px;
    text-align: center;
    color: var(--gray-500);
}
.notify-preview-empty-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 8px;
    opacity: 0.85;
}
.notify-preview-empty p {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin: 0 0 4px;
}
.notify-preview-empty-hint {
    font-size: 12px;
    color: var(--gray-500);
    line-height: 1.4;
}
.notify-preview-item {
    display: block;
    padding: 12px 14px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.15s, border-color 0.15s;
}
.notify-preview-item:last-child { border-bottom: none; }
.notify-preview-item:hover {
    background: #f5f7ff;
}
.notify-preview-item.unread {
    background: linear-gradient(90deg, #fffbeb 0%, #fff 28%);
    border-left: 4px solid #f59e0b;
    padding-left: 10px;
}
.notify-preview-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.notify-preview-type-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}
.notify-preview-main { flex: 1; min-width: 0; }
.notify-preview-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 4px;
}
.notify-type-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.02em;
}
.notify-type-tag.tag-warn {
    background: #fef3c7;
    color: #b45309;
}
.notify-type-tag.tag-success {
    background: #dcfce7;
    color: #166534;
}
.notify-type-tag.tag-info {
    background: #e0f2fe;
    color: #0369a1;
}
.notify-preview-task {
    font-size: 11px;
    color: var(--gray-500);
}
.notify-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    margin-left: auto;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px #fff;
}
.notify-preview-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 2px;
    line-height: 1.35;
}
.notify-preview-body {
    font-size: 12px;
    color: var(--gray-600);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.notify-preview-time {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 6px;
}
.notify-dropdown-foot {
    padding: 10px 12px 12px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}
.notify-view-all {
    text-decoration: none;
    text-align: center;
    justify-content: center;
}
.notify-view-all:hover {
    filter: brightness(1.05);
}

/* 实时消息 Toast */
.notify-toast-host {
    position: fixed;
    top: 72px;
    right: 20px;
    z-index: 10050;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(360px, calc(100vw - 32px));
    pointer-events: none;
}
.notify-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
    text-decoration: none;
    color: inherit;
    animation: notifyToastIn 0.28s ease-out;
}
.notify-toast-out {
    animation: notifyToastOut 0.22s ease-in forwards;
}
.notify-toast-icon { font-size: 20px; line-height: 1; margin-top: 1px; }
.notify-toast-body { flex: 1; min-width: 0; }
.notify-toast-title {
    font-size: 14px;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 4px;
}
.notify-toast-text {
    font-size: 13px;
    color: #78350f;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.notify-toast-close {
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}
.notify-toast-close:hover { color: #64748b; }
@keyframes notifyToastIn {
    from { opacity: 0; transform: translateX(16px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes notifyToastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(16px); }
}
.notify-bell-shake {
    animation: notifyBellShake 0.55s ease-in-out;
}
@keyframes notifyBellShake {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(-12deg); }
    40% { transform: rotate(12deg); }
    60% { transform: rotate(-8deg); }
    80% { transform: rotate(8deg); }
}

.page-content {
    padding: 26px;
}

/* 页面标题 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 15px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title .icon { font-size: 26px; }

/* 卡片 */
.card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow 0.3s;
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body { padding: 24px; }

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
}

.stat-card .stat-value {
    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 4px;
}

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

.stat-blue .stat-icon { background: #e8eaf6; color: var(--primary); }
.stat-green .stat-icon { background: #e8f5e9; color: var(--success); }
.stat-orange .stat-icon { background: #fff3e0; color: var(--warning); }
.stat-red .stat-icon { background: #ffebee; color: var(--danger); }
.stat-cyan .stat-icon { background: #e0f7fa; color: var(--info); }

.stat-blue .stat-value { color: var(--primary); }
.stat-green .stat-value { color: var(--success); }
.stat-orange .stat-value { color: var(--warning); }
.stat-red .stat-value { color: var(--danger); }
.stat-cyan .stat-value { color: var(--info); }

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.25s ease;
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(40,53,147,0.35);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #43a047);
    color: #fff;
}
.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(46,125,50,0.35);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #d32f2f);
    color: #fff;
}
.btn-warning {
    background: linear-gradient(135deg, var(--warning), #f57c00);
    color: #fff;
}
.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}
.btn-secondary:hover { background: var(--gray-300); }
.btn-outline {
    background: transparent;
    border: 2px solid var(--gray-300);
    color: var(--gray-700);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 6px 13px; font-size: 13px; }
.btn-lg { padding: 12px 26px; font-size: 16px; }
.btn-block { width: 100%; }

/* 表格 */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    background: var(--gray-50);
    padding: 13px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

.data-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
}

.data-table tr:hover td { background: var(--gray-50); }
.data-table tr:last-child td { border-bottom: none; }

/* 固定列宽表格：长文本省略，避免换行错位 */
.data-table--fixed {
    table-layout: fixed;
    min-width: 1080px;
}
.data-table--fixed .cell-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 0;
}
.data-table--fixed .cell-nowrap {
    white-space: nowrap;
}
.data-table--fixed .cell-actions {
    white-space: nowrap;
    width: 1%;
}

/* 表单 */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-700);
}
.form-label-required::after { content: ' *'; color: var(--danger); }

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    transition: all 0.25s;
    background: #fff;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(40,53,147,0.08);
}
textarea.form-control { min-height: 90px; resize: vertical; }
select.form-control { appearance: auto; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

/* 状态标签 */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-primary { background: #e8eaf6; color: var(--primary); }
.badge-success { background: #e8f5e9; color: var(--success); }
.badge-danger { background: #ffebee; color: var(--danger); }
.badge-warning { background: #fff3e0; color: var(--warning); }
.badge-info { background: #e1f5fe; color: var(--info); }
.badge-default { background: var(--gray-200); color: var(--gray-600); }

/* 提示框 */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 18px;
    border-left: 4px solid transparent;
}
.alert-error { background: #ffebee; color: #b71c1c; border-left-color: var(--danger); }
.alert-success { background: #e8f5e9; color: #1b5e20; border-left-color: var(--success); }
.alert-warning { background: #fff3e0; color: #e65100; border-left-color: var(--warning); }
.alert-info { background: #e3f2fd; color: #01579b; border-left-color: var(--info); }

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 24px;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    text-decoration: none;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
    transition: all 0.2s;
}
.pagination a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .disabled { opacity: 0.5; pointer-events: none; }

/* 模态框/弹窗 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-box {
    background: #fff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 70px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 22px 26px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 { font-size: 18px; font-weight: 600; }
.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-500);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.modal-close:hover { background: var(--gray-100); color: var(--danger); }
.modal-body { padding: 26px; }
.modal-footer {
    padding: 18px 26px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

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

/* 搜索栏 */
.search-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}
.search-input {
    width: 100%;
    padding: 9px 14px 9px 38px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    outline: none;
    font-size: 14px;
    transition: all 0.25s;
}
.search-input:focus { border-color: var(--primary); }
.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 16px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--gray-500);
}
.empty-state .empty-icon { font-size: 56px; margin-bottom: 14px; }
.empty-state p { font-size: 15px; margin-bottom: 18px; }

/* 操作按钮组 */
.action-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.action-btn {
    padding: 5px 11px;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.action-btn-edit { background: #e3f2fd; color: #1565c0; }
.action-btn-edit:hover { background: #bbdefb; }
.action-btn-delete { background: #ffebee; color: #c62828; }
.action-btn-delete:hover { background: #ffcdd2; }
.action-btn-view { background: #e8f5e9; color: #2e7d32; }
.action-btn-view:hover { background: #c8e6c9; }
.action-btn-scan { background: #fff3e0; color: #e65100; }
.action-btn-scan:hover { background: #ffe0b2; }
.action-btn-depart { background: #e8eaf6; color: #303f9f; }
.action-btn-depart:hover { background: #c5cae9; }
.action-btn-confirm { background: #e0f2f1; color: #00796b; }
.action-btn-confirm:hover { background: #b2dfdb; }

/* 头像 */
.avatar { 
    width: 38px; height: 38px; 
    border-radius: 50%; 
    object-fit: cover; 
    border: 2px solid var(--gray-200);
}
.avatar-sm { width: 30px; height: 30px; }
.avatar-lg { width: 56px; height: 56px; }

/* 下拉菜单 */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 6px;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 1100;
    display: none;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--gray-700);
    text-decoration: none;
    transition: all 0.15s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
}
.dropdown-item:hover { background: var(--gray-100); color: var(--primary); }
.dropdown-divider { height: 1px; background: var(--gray-200); margin: 4px 0; }

/* 标签页 */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 20px;
    gap: 4px;
    overflow-x: auto;
}
.tab-item {
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    white-space: nowrap;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}
.tab-item:hover { color: var(--primary); }
.tab-item.active { color: var(--primary); border-bottom-color: var(--primary); }

/* 工具提示 */
.tooltip-trigger {
    position: relative;
    cursor: help;
}
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-900);
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    pointer-events: none;
    z-index: 1200;
}
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }
    
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    
    .main-wrapper { margin-left: 0; }
    
    .menu-toggle { display: block; }
    
    .page-content { padding: 16px; }
    
    .page-header { flex-direction: column; align-items: flex-start; }
    
    .form-row { grid-template-columns: 1fr; }
    
    .search-bar { flex-direction: column; }
    .search-input-wrap { width: 100%; }
    
    .card-body { padding: 16px; }
    .card-header { padding: 14px 16px; }
    
    .data-table th, .data-table td { padding: 10px 12px; font-size: 13px; }
    
    .modal-box { margin: 10px; max-width: none; }
    
    .header-left .breadcrumb { display: none; }
    
    .stats-grid { grid-template-columns: 1fr; }
    
    .action-btns { flex-direction: column; }
    
    /* 移动端侧边栏遮罩 */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    .sidebar-overlay.show { display: block; }
}

@media print {
    .sidebar, .top-header, .btn, .action-btns { display: none !important; }
    .main-wrapper { margin-left: 0 !important; }
    body { background: #fff; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}
