/**
 * 物业管理系统 - 主样式文件
 * 
 * 功能说明：定义管理后台全局样式
 * 作者：Robin
 * 日期：2026-03-06
 */

/* ==================== CSS变量 ==================== */
:root {
    --primary-color: #3498db;
    --primary-dark: #2980b9;
    --secondary-color: #6c757d;
    --success-color: #27ae60;
    --success-dark: #219a52;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #17a2b8;
    
    --bg-color: #f5f7fa;
    --sidebar-bg: #2c3e50;
    --sidebar-hover: #34495e;
    --card-bg: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #e0e0e0;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    --transition: all 0.3s ease;
}

/* ==================== 重置样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-color);
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ==================== 登录页面 ==================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.login-header {
    padding: 40px 30px 20px;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 36px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
}

.login-header p {
    opacity: 0.9;
    font-size: 14px;
}

.login-form {
    padding: 30px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 13px;
}

.login-form label i {
    margin-right: 5px;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: var(--transition);
}

.login-form input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.login-form .remember {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-label input {
    margin-right: 8px;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 500;
    transition: var(--transition);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.login-footer {
    padding: 20px 30px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 12px;
}

/* ==================== 主布局 ==================== */
.main-app {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transition: var(--transition);
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo i {
    font-size: 28px;
    color: var(--primary-color);
}

.logo span {
    font-size: 16px;
    font-weight: 600;
}

.sidebar.collapsed .logo span {
    display: none;
}

.sidebar-nav {
    flex: 1;
    padding: 15px 0;
    overflow-y: auto;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin: 4px 10px;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: var(--radius-md);
    transition: var(--transition);
    color: rgba(255,255,255,0.8);
}

.sidebar-nav li a:hover,
.sidebar-nav li.active a {
    background: var(--sidebar-hover);
    color: white;
}

.sidebar-nav li.active a {
    background: var(--primary-color);
}

.sidebar-nav li i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar.collapsed .sidebar-nav li span {
    display: none;
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.user-avatar {
    font-size: 32px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 500;
    font-size: 13px;
}

.user-role {
    font-size: 11px;
    opacity: 0.7;
}

.sidebar.collapsed .user-details {
    display: none;
}

.btn-logout {
    width: 100%;
    padding: 10px;
    background: rgba(255,255,255,0.1);
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-logout:hover {
    background: rgba(255,255,255,0.2);
}

.sidebar.collapsed .btn-logout span {
    display: none;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.sidebar.collapsed + .main-content {
    margin-left: 70px;
}

/* 顶部导航 */
.top-header {
    height: 60px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-toggle {
    width: 40px;
    height: 40px;
    background: var(--bg-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-toggle:hover {
    background: var(--border-color);
}

.header-left h2 {
    font-size: 18px;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-time {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.btn-notification {
    position: relative;
    width: 40px;
    height: 40px;
    background: var(--bg-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-notification:hover {
    background: var(--border-color);
}

.btn-notification .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    background: var(--danger-color);
    color: white;
    border-radius: 9px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 页面内容 */
.page-content {
    flex: 1;
    padding: 20px;
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== 统计卡片 ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-card.mini {
    padding: 15px 20px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-card.mini .stat-icon {
    width: 50px;
    height: 50px;
    font-size: 20px;
}

.stat-icon.blue { background: linear-gradient(135deg, #3498db, #2980b9); }
.stat-icon.green { background: linear-gradient(135deg, #27ae60, #219a52); }
.stat-icon.orange { background: linear-gradient(135deg, #f39c12, #d68910); }
.stat-icon.red { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.stat-icon.purple { background: linear-gradient(135deg, #9b59b6, #8e44ad); }

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-card.mini .stat-info h3 {
    font-size: 22px;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 13px;
}

/* ==================== 卡片 ==================== */
.card {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h3 i {
    color: var(--primary-color);
}

.card-body {
    padding: 20px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.chart-card .chart-container {
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================== 表格 ==================== */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-color);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: var(--bg-color);
}

.data-table td {
    font-size: 14px;
}

.data-table .loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* ==================== 按钮 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: var(--success-dark);
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background: #d68910;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-link {
    background: transparent;
    color: var(--primary-color);
    padding: 5px 10px;
}

.btn-link:hover {
    text-decoration: underline;
}

/* 操作栏按钮组 */
.data-table td.actions {
    white-space: nowrap;
}

.data-table td.actions .btn {
    margin: 0 2px;
    vertical-align: middle;
}

.data-table td.actions .btn:last-child {
    margin-right: 0;
}

/* ==================== 表单 ==================== */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group label i {
    margin-right: 5px;
    color: var(--text-secondary);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="month"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: var(--transition);
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group input:read-only {
    background: var(--bg-color);
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
    min-width: 150px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.required {
    color: var(--danger-color);
}

.search-form {
    margin: -5px;
}

.search-form .form-row {
    align-items: flex-end;
}

.search-form .form-group:last-child {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

/* ==================== 分页 ==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 15px 0;
}

.pagination button {
    min-width: 35px;
    height: 35px;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: var(--radius-sm);
    font-size: 13px;
    transition: var(--transition);
}

.pagination button:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination button.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .page-info {
    margin: 0 15px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* ==================== 状态标签 ==================== */
.status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-success, .status-paid {
    background: rgba(39, 174, 96, 0.1);
    color: var(--success-color);
}

.status-pending, .status-unpaid {
    background: rgba(243, 156, 18, 0.1);
    color: var(--warning-color);
}

.status-failed {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
}

.status-overdue {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
}

.status-processed {
    background: rgba(52, 152, 219, 0.1);
    color: var(--primary-color);
}

.type-residential {
    background: rgba(52, 152, 219, 0.1);
    color: var(--primary-color);
}

.type-commercial {
    background: rgba(155, 89, 182, 0.1);
    color: #9b59b6;
}

/* ==================== 模态框 ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.modal-content.modal-lg {
    max-width: 800px;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: var(--bg-color);
    border-radius: 50%;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--danger-color);
    color: white;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ==================== 详情展示 ==================== */
.detail-section {
    margin-bottom: 20px;
}

.detail-section h4 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.detail-section h4 i {
    margin-right: 8px;
    color: var(--primary-color);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item label {
    font-size: 12px;
    color: var(--text-secondary);
}

.detail-item span {
    font-size: 14px;
    font-weight: 500;
}

/* ==================== 导入步骤 ==================== */
.import-steps {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.step {
    display: flex;
    gap: 15px;
}

.step-number {
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content h4 {
    font-size: 15px;
    margin-bottom: 12px;
}

.preview-section {
    margin-top: 20px;
    padding: 15px;
    background: var(--bg-color);
    border-radius: var(--radius-md);
}

.preview-section h4 {
    font-size: 14px;
    margin-bottom: 10px;
}

.preview-info p {
    margin-bottom: 8px;
}

/* 物业费单价显示区域 */
.price-info-box {
    background: linear-gradient(135deg, #e8f4fd 0%, #f5f7fa 100%);
    border: 1px solid #d4e6f9;
    border-radius: var(--radius-md);
    padding: 15px 20px;
    margin-bottom: 20px;
}

.price-info-box h4 {
    font-size: 14px;
    color: var(--primary-color);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-row {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.price-item {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.price-label {
    color: var(--text-secondary);
    font-size: 13px;
}

.price-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.price-unit {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 预览网格 */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 15px;
}

.preview-item {
    background: white;
    border-radius: var(--radius-md);
    padding: 15px;
    box-shadow: var(--shadow-sm);
}

.preview-item.residential {
    border-left: 4px solid var(--success-color);
}

.preview-item.commercial {
    border-left: 4px solid var(--warning-color);
}

.preview-item h5 {
    font-size: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-item.residential h5 {
    color: var(--success-color);
}

.preview-item.commercial h5 {
    color: var(--warning-color);
}

.preview-item p {
    margin-bottom: 6px;
    font-size: 13px;
}

.preview-item .amount {
    color: var(--danger-color);
    font-weight: 600;
    font-size: 15px;
}

.preview-total {
    background: white;
    border-radius: var(--radius-md);
    padding: 12px 15px;
    text-align: center;
    border-top: 2px solid var(--primary-color);
}

.preview-total p {
    margin: 0;
    font-size: 14px;
}

.preview-total .amount {
    color: var(--danger-color);
    font-weight: 700;
    font-size: 18px;
}

/* 表单提示 */
.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.preview-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

/* ==================== 选项卡 ==================== */
.page-tabs {
    display: flex;
    gap: 5px;
    background: var(--bg-color);
    padding: 5px;
    border-radius: var(--radius-md);
}

.tab-btn {
    padding: 10px 20px;
    background: transparent;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    background: white;
    color: var(--primary-color);
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ==================== 设置页面 ==================== */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.settings-grid .card {
    display: flex;
    flex-direction: column;
}

.settings-grid .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.settings-grid .card-body form {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.settings-grid .card-body > .btn {
    margin-top: auto;
    align-self: flex-start;
}

.settings-grid .card-body form .btn {
    margin-top: auto;
    align-self: flex-start;
}

/* ==================== 最近列表 ==================== */
.recent-list {
    max-height: 300px;
    overflow-y: auto;
}

.recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.recent-item:last-child {
    border-bottom: none;
}

.recent-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.recent-item-title {
    font-weight: 500;
}

.recent-item-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

.recent-item-action {
    font-size: 12px;
}

.empty-tip {
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
    font-size: 14px;
}

/* ==================== Toast提示 ==================== */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

.toast.show {
    display: block;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

.toast.info {
    border-left: 4px solid var(--info-color);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==================== 加载遮罩 ==================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    text-align: center;
}

.loading-spinner i {
    font-size: 40px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.loading-spinner p {
    color: var(--text-secondary);
}

/* ==================== 页面头部 ==================== */
.page-header {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-actions {
    display: flex;
    gap: 10px;
}

/* ==================== 状态徽章 ==================== */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.status-1,
.status-badge.status-active {
    background: #d4edda;
    color: #155724;
}

.status-badge.status-0,
.status-badge.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.status-unpaid {
    background: #fff3cd;
    color: #856404;
}

.status-badge.status-paid {
    background: #d4edda;
    color: #155724;
}

.status-badge.status-overdue {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.status-pending {
    background: #cce5ff;
    color: #004085;
}

.status-badge.status-success {
    background: #d4edda;
    color: #155724;
}

.status-badge.status-failed {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.status-processed {
    background: #d4edda;
    color: #155724;
}

/* ==================== 角色徽章 ==================== */
.role-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.role-badge.role-super_admin {
    background: #e7f3ff;
    color: #0056b3;
}

.role-badge.role-admin {
    background: #fff3cd;
    color: #856404;
}

.role-badge.role-operator {
    background: #e8f5e9;
    color: #2e7d32;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .search-form .form-group:last-child {
        flex-direction: column;
    }
    
    .modal-content {
        margin: 10px;
        max-height: 95vh;
    }
}

/* ==================== 按类型分组统计卡片 ==================== */
.type-stats {
    margin-bottom: 20px;
}

.stat-card.type-card {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    overflow: hidden;
}

.stat-card.type-card .stat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    font-weight: 600;
    font-size: 16px;
    color: white;
}

.stat-card.type-card.electric .stat-header {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.stat-card.type-card.property .stat-header {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.stat-card.type-card.heating .stat-header {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.stat-card.type-card .stat-body {
    padding: 15px 20px;
}

.stat-card.type-card .stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.stat-card.type-card .stat-row:last-child {
    border-bottom: none;
}

.stat-card.type-card .stat-row.highlight {
    background: var(--bg-color);
    margin: 5px -20px -15px;
    padding: 12px 20px;
}

.stat-card.type-card .stat-label {
    color: var(--text-secondary);
    font-size: 13px;
}

.stat-card.type-card .stat-value {
    font-weight: 600;
    font-size: 15px;
}

.stat-card.type-card .stat-row.highlight .stat-value {
    font-size: 18px;
    color: var(--primary-color);
}

/* ==================== 批量处理弹窗 ==================== */
.batch-info {
    background: var(--bg-color);
    padding: 15px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.batch-info p {
    margin: 5px 0;
}

.batch-warning {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #fff3cd;
    border-radius: var(--radius-md);
    color: #856404;
    font-size: 13px;
    margin-top: 15px;
}

/* ==================== 选中计数 ==================== */
.selected-count {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--bg-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

/* ==================== 预览统计 ==================== */
.preview-stats {
    background: var(--bg-color);
    padding: 15px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 15px;
}

.preview-stats p {
    margin: 5px 0;
    font-size: 13px;
}

/* ==================== 导入预览表格 ==================== */
#importPreviewTable,
#electricPreviewTable {
    max-height: 300px;
    overflow-y: auto;
}
