/* 销售管理系统自定义样式 */

/* 9:16移动端适配 */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .card {
        margin-bottom: 15px;
    }
    
    .table {
        font-size: 0.85rem;
    }
    
    .btn-sm {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-content {
        border-radius: 0.5rem;
    }
}

/* 登录页面样式 */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.login-page .card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-page .card-body {
    padding: 2.5rem;
}

/* 导航栏样式 */
/* 卡片样式 */
.card-header {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
}

/* 表格样式 */
.table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
}

/* 统计卡片样式 */
.card.text-white {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.card.text-white:hover {
    transform: translateY(-5px);
}

.card.text-white .card-title {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.card.text-white h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

/* 徽章样式 */
.badge {
    padding: 0.35em 0.65em;
    font-weight: 500;
}

/* 按钮样式 */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
}

.btn-sm {
    border-radius: 0.25rem;
}

/* 表单样式 */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* 模态框样式 */
.modal-header {
    border-bottom: 2px solid #dee2e6;
    padding: 1rem 1.5rem;
}

.modal-footer {
    border-top: 2px solid #dee2e6;
    padding: 1rem 1.5rem;
}

/* 响应式表格 */
@media (max-width: 576px) {
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
    
    .btn-group {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 2rem;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* 文本颜色 */
.text-success {
    color: #198754 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-warning {
    color: #ffc107 !important;
}

/* 页脚样式 */
footer {
    margin-top: auto;
    border-top: 1px solid #dee2e6;
}

/* 工具提示 */
.tooltip {
    font-size: 0.875rem;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 顶部导航栏（PC端） */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #0d6efd;
    display: none;
    align-items: center;
    z-index: 1050;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 0;
}

.top-nav .container-fluid {
    padding: 0 2rem;
    height: 100%;
    display: flex;
    align-items: center;
}

.top-nav .d-flex {
    width: 100%;
    height: 100%;
}

.top-nav h5 {
    white-space: nowrap;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.top-nav-links {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    flex-wrap: nowrap;
    margin-left: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.top-nav-links::-webkit-scrollbar {
    display: none;
}

.top-nav-link {
    color: #cfe2ff;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    transition: all 0.2s;
    white-space: nowrap;
    height: 36px;
    flex-shrink: 0;
}

.top-nav-link span {
    display: inline-block;
}

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

.top-nav-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.25);
    font-weight: 600;
}

.top-nav-link i {
    font-size: 1rem;
}

.top-nav .btn-outline-light {
    white-space: nowrap;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* PC端显示顶部导航，隐藏底部导航 */
@media (min-width: 993px) {
    .top-nav {
        display: flex !important;
    }
    body {
        padding-top: 60px !important;
        padding-bottom: 0 !important;
    }
    .main-content {
        margin-top: 0;
    }
    .mobile-bottom-nav {
        display: none !important;
    }
}

/* 移动端强制隐藏顶部导航，显示底部导航 */
@media (max-width: 992px) {
    /* 完全隐藏顶部导航栏 */
    .top-nav {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        overflow: hidden !important;
        position: absolute !important;
        top: -9999px !important;
        left: -9999px !important;
        opacity: 0 !important;
        pointer-events: none !important;
        width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        z-index: -1 !important;
    }
    
    .top-nav * {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    body {
        padding-top: 0 !important;
        padding-bottom: 160px !important;
    }
    
    .main-content {
        margin-top: 0 !important;
    }
    
    .mobile-bottom-nav {
        display: block !important;
        visibility: visible !important;
    }
}

/* 移动端底部导航栏（两行布局） */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 160px;
    background: #ffffff;
    border-top: 2px solid #e9ecef;
    z-index: 1050;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
    display: none;
    padding-bottom: env(safe-area-inset-bottom);
    box-sizing: border-box;
}

.mobile-nav-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 12px 8px;
    max-width: 100%;
    box-sizing: border-box;
    gap: 8px;
}

.mobile-nav-row {
    display: flex;
    align-items: center;
    justify-content: space-around;
    flex: 0 0 auto;
    width: 100%;
    height: 68px;
    min-height: 68px;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    overflow: visible;
}

.mobile-nav-item {
    color: #495057;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
    max-width: 25%;
    height: 100%;
    min-height: 64px;
    padding: 8px 4px;
    margin: 0 4px;
    transition: all 0.25s ease;
    border-radius: 12px;
    position: relative;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
    overflow: visible;
    background: transparent;
}

.mobile-nav-item i {
    font-size: 28px;
    margin-bottom: 6px;
    transition: all 0.25s ease;
    flex-shrink: 0;
    display: block;
    line-height: 1;
    color: inherit;
}

.mobile-nav-item span {
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.25s ease;
    text-align: center;
    line-height: 1.3;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    color: inherit;
}

.mobile-nav-item:hover {
    color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.08);
    transform: translateY(-2px);
}

.mobile-nav-item.active {
    color: #0d6efd;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.12) 0%, rgba(13, 110, 253, 0.08) 100%);
    font-weight: 600;
}

.mobile-nav-item.active i {
    color: #0d6efd;
    transform: scale(1.15);
    font-weight: 600;
}

.mobile-nav-item.active span {
    font-weight: 700;
    color: #0d6efd;
    font-size: 13px;
}

.mobile-nav-item.active::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: linear-gradient(90deg, #0d6efd 0%, #4dabf7 100%);
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.3);
}

/* 移动端导航项点击反馈 */
.mobile-nav-item:active {
    background-color: rgba(13, 110, 253, 0.2);
    transform: scale(0.96) translateY(0);
}

/* 移动端显示底部导航 */
@media (max-width: 992px) {
    .mobile-bottom-nav {
        display: block !important;
    }
    body {
        padding-bottom: 160px !important;
    }
}

/* PC端隐藏移动端导航 */
@media (min-width: 993px) {
    .mobile-bottom-nav {
        display: none !important;
    }
}

/* 订单卡片样式 */
.order-card {
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e9ecef;
    background: #fff;
}

.order-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1) !important;
}

.order-info {
    font-size: 0.9rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.info-row .label {
    color: #6c757d;
    font-weight: 500;
}

.info-row .value {
    color: #212529;
    font-weight: 600;
}

.order-summary {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 1rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.summary-row:not(:last-child) {
    border-bottom: 1px solid #dee2e6;
}

.summary-label {
    font-size: 0.95rem;
    color: #495057;
    font-weight: 500;
}

.summary-value {
    font-size: 1.1rem;
    font-weight: 700;
}

/* 分页样式 */
.pagination {
    margin-top: 2rem;
}

.page-link {
    color: #007bff;
    border-radius: 0.375rem;
    margin: 0 0.25rem;
}

.page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
}

.page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    cursor: auto;
}

/* 搜索栏样式 */
.form-control:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* 客户卡片样式 */
.customer-card {
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e9ecef;
}

.customer-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1) !important;
}

/* 库存卡片样式 */
.inventory-card {
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e9ecef;
}

.inventory-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1) !important;
}

/* 未回款卡片样式 */
.unpaid-card {
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid #ffc107 !important;
}

.unpaid-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(255, 193, 7, 0.2) !important;
}

/* 发票卡片样式 */
.invoice-card {
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e9ecef;
}

.invoice-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1) !important;
}

/* 最近订单卡片样式 */
.recent-order-card {
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e9ecef;
}

.recent-order-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1) !important;
}

/* 用户卡片样式 */
.user-card {
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e9ecef;
}

.user-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1) !important;
}

.user-info {
    font-size: 0.9rem;
}

.user-info .info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.user-info .label {
    color: #6c757d;
    font-weight: 500;
}

.user-info .value {
    color: #212529;
    font-weight: 600;
}

@media (max-width: 768px) {
    .order-card, .customer-card, .inventory-card, .unpaid-card, .invoice-card, .recent-order-card, .user-card {
        margin-bottom: 1rem;
    }
    
    .info-row, .summary-row {
        font-size: 0.85rem;
    }
    
    .summary-value {
        font-size: 1rem;
    }
}

