/* 友商ERP - 门户风格样式 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --sidebar-width: 220px;
    --topnav-height: 56px;
    --sidebar-bg: #1a1d23;
    --sidebar-hover: #252830;
    --sidebar-active: #0d6efd;
    --sidebar-text: #8b8fa3;
    --sidebar-text-active: #ffffff;
    --content-bg: #0f1117;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--content-bg);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== 顶部导航 ===== */
.topnav {
    height: var(--topnav-height);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background: #16181e !important;
    backdrop-filter: blur(12px);
}

/* ===== 侧边栏 ===== */
.sidebar {
    position: fixed;
    top: var(--topnav-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid rgba(255,255,255,0.06);
    z-index: 1020;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.sidebar-inner {
    padding: 12px 0;
}

.sidebar-section {
    margin-bottom: 8px;
}

.sidebar-section-title {
    padding: 8px 16px 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #5a5e72;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
    gap: 10px;
}

.sidebar-item:hover {
    background: var(--sidebar-hover);
    color: #c8cbd8;
}

.sidebar-item.active {
    background: rgba(13, 110, 253, 0.1);
    color: var(--sidebar-text-active);
    border-left-color: var(--sidebar-active);
}

.sidebar-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar-item .badge {
    font-size: 0.65rem;
}

.disabled-link {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===== 主内容区 ===== */
.main-content {
    margin-top: var(--topnav-height);
    margin-left: var(--sidebar-width);
    padding: 24px;
    min-height: calc(100vh - var(--topnav-height));
    transition: margin-left 0.2s ease;
}

/* ===== Flash 消息 ===== */
.flash-container {
    position: fixed;
    top: calc(var(--topnav-height) + 10px);
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}

.flash-container .alert {
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    border: none;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ===== 门户风格卡片 ===== */
.card {
    border: 1px solid rgba(255,255,255,0.06);
    background: #16181e;
    border-radius: 12px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 16px 20px;
}

.card-body {
    padding: 20px;
}

/* ===== 门户模块入口卡片 ===== */
.module-card {
    border: 1px solid rgba(255,255,255,0.06);
    background: #16181e;
    border-radius: 16px;
    padding: 24px;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    display: block;
    height: 100%;
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
    border-color: rgba(13, 110, 253, 0.3);
}

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

.module-card .module-title {
    font-size: 1rem;
    font-weight: 600;
    color: #e4e6ef;
    margin-bottom: 4px;
}

.module-card .module-desc {
    font-size: 0.8rem;
    color: #5a5e72;
}

.module-card.coming-soon {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(0.5);
}

/* ===== 统计卡片 ===== */
.stat-card {
    border-radius: 16px;
    padding: 20px 24px;
    border: none;
    position: relative;
    overflow: hidden;
    height: 100%;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}

.stat-card .stat-icon {
    position: absolute;
    right: 20px;
    bottom: 20px;
    font-size: 2.5rem;
    opacity: 0.2;
}

.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* ===== 表格 ===== */
.table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: rgba(255,255,255,0.03);
    margin-bottom: 0;
}

.table thead th {
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #5a5e72;
    padding: 12px 16px;
}

.table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.table-hover tbody tr {
    transition: background-color 0.1s ease;
}

/* ===== 进度条 ===== */
.progress {
    background-color: rgba(255,255,255,0.06);
    border-radius: 8px;
}

/* ===== Badge ===== */
.badge {
    font-weight: 500;
    letter-spacing: 0.3px;
    padding: 0.35em 0.65em;
    border-radius: 6px;
}

/* ===== 按钮 ===== */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 8px 16px;
}

.btn-sm {
    border-radius: 6px;
    padding: 4px 12px;
}

.btn-lg {
    border-radius: 12px;
    padding: 12px 24px;
}

/* ===== Code ===== */
code {
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(13, 110, 253, 0.1);
    color: #6ea8fe;
}

/* ===== 分页 ===== */
.pagination .page-link {
    border-radius: 8px !important;
    margin: 0 2px;
    border: none;
    background: transparent;
    color: var(--sidebar-text);
}

.pagination .page-item.active .page-link {
    background: var(--sidebar-active);
    color: white;
}

/* ===== 下拉菜单 ===== */
.dropdown-menu {
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 8px;
}

.dropdown-item {
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.875rem;
}

/* ===== 登录页 ===== */
.auth-card {
    border: 1px solid rgba(255,255,255,0.08);
    background: #16181e;
    border-radius: 20px;
    padding: 40px;
    max-width: 420px;
    width: 100%;
}

/* ===== 表单 ===== */
.form-control, .form-select {
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    padding: 10px 16px;
    font-size: 0.9rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--sidebar-active);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
    background: rgba(255,255,255,0.06);
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: #8b8fa3;
}

/* ===== 小屏适配 ===== */
@media (max-width: 991px) {
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
    
    .offcanvas {
        --bs-offcanvas-width: 260px;
    }
    
    .offcanvas .sidebar-inner {
        padding-top: 0;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 12px;
    }
    
    .stat-card .stat-value {
        font-size: 1.4rem;
    }
}
