/* 企业级管理后台样式 - 微信色系 */

/* 全局变量 */
:root {
    --primary-color: #07C160;
    --primary-dark: #06a852;
    --background-color: #f5f7fa;
    --card-background: #ffffff;
    --text-color: #333333;
    --border-color: #e8eaed;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --gray-50: #f8f9fa;
    --gray-100: #e9ecef;
    --gray-200: #dee2e6;
    --gray-300: #ced4da;
    --gray-400: #adb5bd;
    --gray-500: #6c757d;
    --gray-600: #495057;
    --gray-700: #343a40;
    --gray-800: #212529;
    --gray-900: #1a1a1a;
}

/* 基础布局 */
.admin-layout {
    display: flex;
    min-height: 100vh;
    background-color: var(--background-color);
}

/* 侧边栏 */
.admin-sidebar {
    width: 240px;
    background: var(--card-background);
    border-right: 1px solid var(--border-color);
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.admin-sidebar .logo {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.admin-sidebar .logo h2 {
    color: var(--primary-color);
    font-size: 18px;
    margin: 0;
    font-weight: 600;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin: 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    text-decoration: none;
    color: #666;
    font-size: 14px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background-color: #e8f5e9;
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
}

.sidebar-nav .icon {
    margin-right: 12px;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* 主内容区 */
/* .admin-main { 已废弃，使用.main-content */
    flex: 1;
    margin-left: 240px;
    padding: 20px;
}

/* 顶部工具栏 */
.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* margin-bottom: 24px; */
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    width:100%;
}

.topbar-left {
    display: flex;
    align-items: center;
}

.topbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-left: auto;
}

.admin-topbar h1 {
    color: var(--text-color);
    font-size: 24px;
    margin: 0;
    font-weight: 600;
}

/* 顶部导航 */
.topbar-nav {
    display: flex;
    align-items: center;
    margin-left: 24px;
}

.topbar-nav-link {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.2s ease;
    background-color: rgba(7, 193, 96, 0.1);
}

.topbar-nav-link:hover {
    background-color: rgba(7, 193, 96, 0.2);
    color: var(--primary-color);
}

.topbar-nav-link .icon {
    margin-right: 8px;
    font-size: 16px;
}

/* 确保右侧内容保持在右边上 */
.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
}

/* 用户菜单 */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    border:none;
}

.user-info {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.user-name {
    font-weight: 500;
    color: var(--text-color);
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: #666;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 180px;
    z-index: 1000;
    display: none;
}

.dropdown-menu.show {
    display: block !important;
}

.dropdown-menu a {
    display: block;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.dropdown-menu a:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
}

/* 卡片组件 - 兼容两种类名 */
.card,
.admin-card {
    background: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 24px;
    margin-bottom: 24px;
}

.card h2,
.admin-card h2 {
    color: var(--text-color);
    font-size: 18px;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
}

/* 表格样式 - 兼容两种类名 */
.table,
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.table th,
.table td,
.admin-table th,
.admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.table th,
.admin-table th {
    background-color: #fafafa;
    font-weight: 600;
    color: #666;
    font-size: 14px;
}

.table tr:hover,
.admin-table tr:hover {
    background-color: #f9f9f9;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 3px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

/* 新增的按钮样式 */
.btn-outline-primary {
    color: var(--primary-color);
    background-color: transparent;
    border: 1px solid var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: #e8f5e9;
    border-color: var(--primary-color);
}

/* 表单样式 */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1);
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

.loading.hidden {
    display: none;
}

/* 错误状态 */
.error {
    color: var(--danger-color);
    padding: 12px;
    background-color: #ffebee;
    border-radius: 4px;
    margin: 16px 0;
}

.error.hidden {
    display: none;
}

/* 消息提示 */
.message {
    padding: 12px;
    border-radius: 4px;
    margin: 16px 0;
    font-size: 14px;
}

.message-success {
    background-color: #d4edda;
    color: #155724;
}

.message-error {
    background-color: #f8d7da;
    color: #721c24;
}

.message.hidden {
    display: none;
}

/* 分页 */
.pagination {
    /* margin-top: 20px; */
    text-align: center;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 4px;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
}

.pagination a:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
}

.pagination .current-page {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 搜索框 */
.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.search-box input {
    flex: 1;
    max-width: 300px;
}

/* 隐藏元素 */
.hidden {
    display: none !important;
}

/* 弹窗样式 */
/* .modal { 已废弃，使用 manager-common.css 中的样式 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-500);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.modal-body {
    margin-bottom: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }
    
    .admin-sidebar {
        position: relative;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 10px 0;
    }
    
    /* .admin-main { 已废弃，使用.main-content */
        margin-left: 0;
        padding: 16px;
    }
    
    .admin-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .topbar-nav {
        margin-left: 0;
        margin-top: 8px;
        width: 100%;
    }
    
    .topbar-nav-link {
        display: inline-flex;
        width: auto;
        padding: 10px 16px;
    }
    
    .user-menu {
        align-self: flex-end;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-box input {
        max-width: none;
    }
    
    .table,
    .admin-table {
        font-size: 12px;
    }
    
    .table th,
    .table td,
    .admin-table th,
    .admin-table td {
        padding: 8px 12px;
    }
}