/* 自定义样式 */

/* 布局样式 */
body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 顶部导航栏 */
.navbar {
    height: 60px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1030;
}

.navbar-brand {
    font-size: 1.1rem;
    font-weight: 600;
}

/* 左侧菜单 */
.sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    width: 250px;
    height: calc(100vh - 60px);
    background: #ffffff;
    border-right: 1px solid #e3e6f0;
    box-shadow: 2px 0 4px rgba(0,0,0,0.05);
    z-index: 1020;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 1rem 1.5rem 0.5rem;
    border-bottom: 1px solid #e3e6f0;
    margin-bottom: 0.5rem;
}

.sidebar-nav {
    padding: 0;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #5a5c69;
    text-decoration: none;
    border-radius: 0;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar .nav-link:hover {
    background-color: #f8f9fc;
    color: #2563eb;
    border-left-color: #2563eb;
}

.sidebar .nav-link.active {
    background-color: #e3f2fd;
    color: #2563eb;
    border-left-color: #2563eb;
    font-weight: 600;
}

.sidebar .nav-link i {
    width: 20px;
    margin-right: 0.75rem;
    font-size: 1rem;
}

/* 主内容区域 */
.main-content {
    margin-left: 250px;
    margin-top: 60px;
    min-height: calc(100vh - 60px);
    padding: 1.5rem;
    transition: all 0.3s ease;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
}

/* 卡片边框颜色 */
.border-left-primary {
    border-left: 0.25rem solid #2563eb !important;
}

.border-left-success {
    border-left: 0.25rem solid #10b981 !important;
}

.border-left-info {
    border-left: 0.25rem solid #06b6d4 !important;
}

.border-left-warning {
    border-left: 0.25rem solid #f59e0b !important;
}

.border-left-danger {
    border-left: 0.25rem solid #ef4444 !important;
}

/* 文本颜色 */
.text-gray-300 {
    color: #9ca3af !important;
}

.text-gray-800 {
    color: #374151 !important;
}

.text-primary {
    color: #2563eb !important;
}

/* 状态徽章 */
.badge-pending {
    background-color: #f59e0b;
    color: #fff;
    font-weight: 500;
}

.badge-claimed {
    background-color: #06b6d4;
    color: #fff;
    font-weight: 500;
}

.badge-tracking {
    background-color: #2563eb;
    color: #fff;
    font-weight: 500;
}

.badge-completed {
    background-color: #10b981;
    color: #fff;
    font-weight: 500;
}

/* 表格样式 */
.table {
    background-color: #ffffff;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table th {
    border-top: none;
    font-weight: 600;
    color: #374151;
    background-color: #f9fafb;
    padding: 1rem;
    font-size: 0.875rem;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    border-color: #f3f4f6;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* 横向滚动表格样式 */
.table-responsive {
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 固定操作列样式 */
.table th:last-child,
.table td:last-child {
    position: sticky;
    right: 0;
    background-color: #f9fafb;
    z-index: 10;
    border-left: 1px solid #e5e7eb;
}

.table td:last-child {
    background-color: #ffffff;
}

.table-hover tbody tr:hover td:last-child {
    background-color: #f8fafc;
}

/* 表格最小宽度确保内容完整显示 */
.table-responsive table {
    white-space: nowrap;
}

.table-responsive table td,
.table-responsive table th {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 按钮样式 */
.btn {
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #2563eb;
    border-color: #2563eb;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* 模态框样式 */
.modal-header {
    background-color: #2563eb;
    color: white;
    border-radius: 0.5rem 0.5rem 0 0;
}

.modal-content {
    border-radius: 0.5rem;
    border: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* 表单样式 */
.form-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-control {
    border-radius: 0.375rem;
    border: 1px solid #d1d5db;
    padding: 0.75rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.1);
    outline: none;
}

/* 卡片样式 */
.card {
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    background-color: #ffffff;
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.card-header {
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: #374151;
}

.card-body {
    padding: 1.5rem;
}

.shadow {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06) !important;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

/* 隐藏元素 */
.d-none {
    display: none !important;
}

/* 文本截断 */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 自定义间距 */
.py-2 {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

/* 图标大小 */
.fa-2x {
    font-size: 2em;
}

/* 角色特定样式 */
.admin-only {
    display: none;
}

.operations-only {
    display: none;
}

.logistics-only {
    display: none;
}

/* 显示角色特定元素 */
body.role-admin .admin-only {
    display: block !important;
}

body.role-operator .operations-only {
    display: block !important;
}

body.role-logistics .logistics-only {
    display: block !important;
}

/* 错误提示 */
.alert {
    border: none;
    border-radius: 0.35rem;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-success {
    background-color: #d1edff;
    color: #0c5460;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

/* 分页样式 */
.pagination {
    margin-bottom: 0;
}

.page-link {
    color: #4e73df;
}

.page-link:hover {
    color: #2e59d9;
    background-color: #eaecf4;
    border-color: #dddfeb;
}

.page-item.active .page-link {
    background-color: #4e73df;
    border-color: #4e73df;
}