/* 等级管理专用样式 */

/* 等级表格样式 */
.level-code {
    font-weight: bold;
    font-family: monospace;
    padding: 2px 6px;
    border-radius: 3px;
    background-color: rgba(0, 0, 0, 0.05);
}

.level-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.level-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

.level-value {
    font-weight: bold;
    color: #2563eb;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 8px;
}

.badge-primary {
    background-color: #3b82f6;
    color: white;
}

.privileges-cell {
    max-width: 200px;
}

.privileges-preview {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
    font-size: 0.875rem;
    color: #6b7280;
}

.privileges-preview:hover {
    white-space: normal;
    background-color: #f9fafb;
    padding: 4px;
    border-radius: 4px;
    cursor: help;
}

/* 用户等级分配表格样式 */
.user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-info strong {
    color: #111827;
    font-size: 0.9rem;
}

.user-info small {
    color: #6b7280;
    font-size: 0.8rem;
}

.assignment-type {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    background-color: #f3f4f6;
    color: #374151;
    font-weight: 500;
}

/* 表单样式增强 */
.level-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.level-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.level-form .form-group.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #374151;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
}

.level-form label {
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.level-form input,
.level-form select,
.level-form textarea {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.level-form input:focus,
.level-form select:focus,
.level-form textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.level-form .field-help {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* 分配表单样式 */
.assign-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.assign-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* 模态框内容增强 */
.modal-body .level-form,
.modal-body .assign-form {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 10px;
}

/* 自定义滚动条 */
.modal-body .level-form::-webkit-scrollbar,
.modal-body .assign-form::-webkit-scrollbar {
    width: 6px;
}

.modal-body .level-form::-webkit-scrollbar-track,
.modal-body .assign-form::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.modal-body .level-form::-webkit-scrollbar-thumb,
.modal-body .assign-form::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.modal-body .level-form::-webkit-scrollbar-thumb:hover,
.modal-body .assign-form::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 过滤栏样式增强 */
.filter-bar {
    background-color: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

.filter-group select,
.filter-group input {
    padding: 0.375rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    min-width: 120px;
}

.filter-group input[type="number"] {
    min-width: 100px;
}

/* 按钮样式增强 */
.btn.btn-outline {
    background-color: transparent;
    border: 1px solid #d1d5db;
    color: #374151;
}

.btn.btn-outline:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

/* 状态标记样式 */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-badge.status-active {
    background-color: #dcfce7;
    color: #166534;
}

.status-badge.status-inactive {
    background-color: #fef2f2;
    color: #991b1b;
}

/* 操作按钮样式 */
.action-buttons {
    display: flex;
    gap: 0.25rem;
}

.action-btn {
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.action-btn.view {
    background-color: #3b82f6;
    color: white;
}

.action-btn.view:hover {
    background-color: #2563eb;
}

.action-btn.edit {
    background-color: #f59e0b;
    color: white;
}

.action-btn.edit:hover {
    background-color: #d97706;
}

.action-btn.delete {
    background-color: #ef4444;
    color: white;
}

.action-btn.delete:hover {
    background-color: #dc2626;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .level-form .form-row,
    .assign-form .form-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .filter-group {
        justify-content: space-between;
    }
    
    .filter-group select,
    .filter-group input {
        min-width: 0;
        flex: 1;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        text-align: center;
    }
}

/* 加载状态样式 */
.loading-row {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 2rem;
}

.no-data {
    text-align: center;
    color: #9ca3af;
    font-style: italic;
    padding: 2rem;
}

/* 等级颜色显示增强 */
.level-name[style*="color"] {
    text-shadow: 0 0 1px rgba(0, 0, 0, 0.1);
}

/* 表格头部样式 */
.table-container table th {
    position: sticky;
    top: 0;
    background-color: #f8fafc;
    z-index: 10;
}

/* 工具提示样式 */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2937;
    color: white;
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
    z-index: 1000;
}

.tooltip:hover::before {
    opacity: 1;
}
