/* ============================================================================
   YETEX TRADE ERP - 主样式表
   ============================================================================ */

html, body {
    height: 100%;
    margin: 0;
}

body {
    font-family: "Microsoft YaHei", Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================================================
   搜索下拉框通用样式
   ============================================================================ */

.navbar-brand .brand-logo svg {
        width: 28px;
        height: 28px;
        fill: currentColor;
        display: block;
}

.navbar-brand .brand-text {
        font-weight: 600;
}
#searchDropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    margin-top: 2px;
    border: 1px solid #dee2e6;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
}

#searchDropdown .dropdown-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

#searchDropdown .dropdown-item:hover {
    background-color: #f8f9fa;
}

#searchDropdown .dropdown-item:last-child {
    border-bottom: none;
}

#searchDropdown .dropdown-item .item-type {
    font-size: 0.75rem;
    color: #6c757d;
    margin-right: 0.5rem;
}

#searchDropdown .dropdown-item .item-name {
    font-weight: 500;
    color: #212529;
}

#searchDropdown .dropdown-item .item-code {
    font-size: 0.875rem;
    color: #6c757d;
    margin-left: 0.5rem;
}

/* ============================================================================
   导航栏样式
   ============================================================================ */

/* 修复菜单下拉菜单与菜单栏重叠问题 */
.navbar .dropdown-menu {
    margin-top: 0.5rem !important;
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.navbar .dropdown-menu .dropdown-item {
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.navbar .dropdown-menu .dropdown-item:hover {
    background-color: #e7f1ff;
    color: #0d6efd;
}

/* ============================================================================
   按钮组样式
   ============================================================================ */

/* 修复按钮组内form导致的按钮高度不一致问题 */
.btn-group {
    display: inline-flex !important;
    gap: 0 !important;
    vertical-align: middle;
}

.btn-group form {
    display: inline !important;
    margin: 0;
    padding: 0;
}

.btn-group form button {
    margin: 0 !important;
    padding: 0.375rem 0.75rem !important;
    background: transparent !important;
    display: inline-block !important;
    vertical-align: middle !important;
    height: auto !important;
    border: 1px solid !important;
    cursor: pointer;
    font-size: inherit;
    font-weight: 500;
    border-radius: 0.25rem;
}

.btn-group-sm form button {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.875rem;
}

.btn-group .btn,
.btn-group form button.btn {
    margin: 0 !important;
    padding: 0.375rem 0.75rem !important;
    display: inline-block !important;
    vertical-align: middle;
    height: auto !important;
}

.btn-group-sm .btn,
.btn-group-sm form button.btn {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.875rem;
}

/* 按钮颜色样式 */
.btn-group form button.btn-outline-primary {
    border-color: #0d6efd !important;
    color: #0d6efd !important;
}

.btn-group form button.btn-outline-primary:hover {
    background-color: rgba(13, 110, 253, 0.15) !important;
    color: #0d6efd !important;
}

.btn-group form button.btn-outline-warning {
    border-color: #ffc107 !important;
    color: #664d03 !important;
}

.btn-group form button.btn-outline-warning:hover {
    background-color: rgba(255, 193, 7, 0.15) !important;
    color: #664d03 !important;
}

.btn-group form button.btn-outline-success {
    border-color: #198754 !important;
    color: #198754 !important;
}

.btn-group form button.btn-outline-success:hover {
    background-color: rgba(25, 135, 84, 0.15) !important;
    color: #198754 !important;
}

.btn-group form button.btn-outline-danger {
    border-color: #dc3545 !important;
    color: #dc3545 !important;
}

.btn-group form button.btn-outline-danger:hover {
    background-color: rgba(220, 53, 69, 0.15) !important;
    color: #dc3545 !important;
}

/* ============================================================================
   用户头像和角标样式
   ============================================================================ */

/* 用户角标样式优化 */
.role-pill {
    background: #0d6efd;
    color: #fff;
    border-radius: 999px;
    padding: 0.25rem 0.6rem;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.avatar-initial {
    width: 32px;
    height: 32px;
    font-weight: 700;
    color: #0d6efd;
    background: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

/* ============================================================================
   页脚样式
   ============================================================================ */

footer.site-footer {
    background: linear-gradient(90deg, #0d6efd 0%, #0b5ed7 100%);
    color: #f8f9fa;
    margin-top: auto;
    padding: 18px 0;
    flex-shrink: 0;
}

footer .footer-link {
    color: #f8f9fa;
    text-decoration: none;
}

footer .footer-link:hover {
    text-decoration: underline;
    color: #dfe9ff;
}

/* ============================================================================
   自定义确认对话框样式（app.php 版本）
   ============================================================================ */

#customConfirmModal .modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

#customConfirmModal .modal-header {
    padding: 1.5rem 1.5rem 0.5rem;
}

#customConfirmModal .modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
}

#customConfirmModal .modal-title i {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

#customConfirmModal .modal-body {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    color: #495057;
    line-height: 1.6;
}

#customConfirmModal .modal-footer {
    padding: 1rem 1.5rem 1.5rem;
    justify-content: flex-end;
    gap: 0.5rem;
}

#customConfirmModal .btn {
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
}

#customConfirmModal .btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
}

#customConfirmModal .btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
    transform: translateY(-1px);
}

#customConfirmModal .btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
}

#customConfirmModal .btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
    transform: translateY(-1px);
}

/* ============================================================================
   仪表板边框样式
   ============================================================================ */

.border-left-primary {
    border-left: 4px solid #007bff !important;
}

.border-left-info {
    border-left: 4px solid #17a2b8 !important;
}

.border-left-success {
    border-left: 4px solid #28a745 !important;
}

.border-left-warning {
    border-left: 4px solid #ffc107 !important;
}

.border-left-danger {
    border-left: 4px solid #dc3545 !important;
}

/* ============================================================================
   图表样式
   ============================================================================ */

.chart-container {
    position: relative;
    width: 100%;
    height: auto;
}

.chart-container-sm {
    max-height: 300px;
}

.chart-container-md {
    max-height: 350px;
}

.chart-container-lg {
    max-height: 400px;
}

.card .card-body canvas {
    max-height: 100%;
}
/* ============================================================================
   统一按钮样式规范
   ============================================================================ */

/* 基础按钮尺寸和间距 */
.btn {
    padding: 0.5rem 1rem;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
}

/* 小按钮（表格操作列） */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    min-width: auto;
}

/* 大按钮（主要操作） */
.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* 按钮组间距 */
.btn + .btn {
    margin-left: 0.5rem;
}

.btn-group .btn {
    margin-left: 0;
    margin-right: 0;
}

/* 按钮容器间距 */
.d-flex.gap-2 .btn {
    margin: 0;
}

/* 表格操作按钮统一样式 */
.table .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    margin: 0 2px;
    border-radius: 3px;
}

/* 操作按钮的一致性处理 */
.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-success,
.btn-outline-danger,
.btn-outline-warning,
.btn-outline-info {
    font-weight: 500;
    transition: all 0.2s ease;
}

/* 按钮悬停效果 */
.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 填充按钮一致性 */
.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger,
.btn-warning,
.btn-info {
    font-weight: 500;
}

/* 按钮焦点状态 */
.btn:focus,
.btn:focus-visible {
    outline: none;
}

/* 禁用状态 */
.btn:disabled,
.btn.disabled {
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
}

/* 按钮组样式 */
.btn-group {
    display: inline-flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* 按钮容器（用于页面顶部、底部等） */
.btn-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

/* 模态框按钮 */
.modal-footer .btn {
    margin-left: auto;
    margin-right: auto;
}

.modal-footer .btn:first-child {
    margin-left: 0;
}

/* 响应式按钮宽度 */
@media (max-width: 576px) {
    .btn-responsive {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}