/* 出库通知单管理系统 - 通用样式 */

/* 主题样式 */
.dark-theme {
    background: #0f172a;
    color: #e2e8f0;
}

/* 卡片样式 */
.card-dark {
    background: #1e293b;
    border: 1px solid #334155;
}

/* 侧边栏样式 */
.sidebar-dark {
    background: #1e293b;
    border-right: 1px solid #334155;
}

/* 侧边栏容器优化 - 防止加载闪烁 */
#sidebar-container {
    /* 桌面端预设样式 */
    @media (min-width: 768px) {
        min-height: 100vh;
        width: 16rem;
        position: fixed;
        left: 0;
        top: 0;
        z-index: 50;
        background: #1e293b;
        border-right: 1px solid #334155;
        opacity: 1;
        visibility: visible;
    }
}

/* 确保侧边栏在桌面端的正确显示 */
@media (min-width: 768px) {
    #sidebar {
        transform: translateX(0) !important;
        transition: none;
    }

    #sidebar.slide-in {
        animation: none;
    }
}

/* 导航项样式 */
.nav-item {
    transition: background-color 0.2s ease;
}

.nav-item:hover {
    background: #334155;
}

.nav-item.active {
    background: #3b82f6;
    color: white;
}

/* 表单输入框样式 */
.form-input {
    background: #374151;
    border: 1px solid #4b5563;
    color: #e5e7eb;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 确保HTML5验证提示能正常显示 */
input:invalid:focus,
select:invalid:focus,
textarea:invalid:focus {
    outline: auto !important;
}

/* 保持自定义样式，但不影响HTML5验证 */
input:not(:invalid):focus,
select:not(:invalid):focus,
textarea:not(:invalid):focus {
    outline: none;
}

/* 按钮样式 */
.btn-primary {
    background: #3b82f6;
    color: white;
    transition: background-color 0.2s ease;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: #6b7280;
    color: white;
    transition: background-color 0.2s ease;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-success {
    background: #10b981;
    color: white;
    transition: background-color 0.2s ease;
}

.btn-success:hover {
    background: #059669;
}

.btn-warning {
    background: #f59e0b;
    color: white;
    transition: background-color 0.2s ease;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-danger {
    background: #ef4444;
    color: white;
    transition: background-color 0.2s ease;
}

.btn-danger:hover {
    background: #dc2626;
}

/* 表格样式 */
.table-row:hover {
    background: #374151;
}

/* 分页样式 */
.pagination-btn {
    background: #374151;
    border: 1px solid #4b5563;
    color: #9ca3af;
    transition: all 0.2s ease;
}

.pagination-btn:hover {
    background: #4b5563;
    color: #e5e7eb;
}

.pagination-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* 面包屑导航样式 */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.breadcrumb-item {
    color: #9ca3af;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.breadcrumb-item:hover {
    color: #d1d5db;
}

.breadcrumb-item.active {
    color: #3b82f6;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar-dark {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar-dark.mobile-open {
        transform: translateX(0);
    }
    
    .breadcrumb {
        font-size: 0.75rem;
    }
}

/* 工具类 */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shadow-custom {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.shadow-custom-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 状态指示器 */
.status-success {
    background: #10b981;
    color: white;
}

.status-warning {
    background: #f59e0b;
    color: white;
}

.status-error {
    background: #ef4444;
    color: white;
}

.status-info {
    background: #3b82f6;
    color: white;
}

/* 加载动画 */
.loading-spinner {
    border: 2px solid #374151;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}