/* PadPro 全局样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif; background: #f0f2f5; color: #333; font-size: 14px; }
a { color: #1890ff; text-decoration: none; }
a:hover { color: #40a9ff; }
img { max-width: 100%; }

/* 登录/注册页容器 */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 20px; }
.auth-box { background: #fff; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.15); width: 100%; max-width: 400px; overflow: hidden; }
.auth-header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; padding: 30px; text-align: center; }
.auth-header h1 { font-size: 24px; margin-bottom: 6px; }
.auth-header p { font-size: 13px; opacity: 0.85; }
.auth-body { padding: 30px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; color: #333; height: 40px; line-height: 40px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; height: 38px; padding: 0 14px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 14px; transition: border-color 0.3s; outline: none; box-sizing: border-box; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #1890ff; box-shadow: 0 0 0 2px rgba(24,144,255,0.1); }
.btn { display: inline-block; padding: 10px 24px; border-radius: 6px; font-size: 14px; font-weight: 500; cursor: pointer; border: none; transition: all 0.3s; text-align: center; }
.btn-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(102,126,234,0.4); }
.btn-block { display: block; width: 100%; }
.btn-secondary { background: #fff; color: #667eea; border: 1px solid #667eea; }
.btn-secondary:hover { background: #f0f0ff; }
.auth-footer { text-align: center; padding: 0 30px 25px; font-size: 13px; color: #666; }
.auth-footer a { color: #667eea; font-weight: 500; }

/* 错误提示 */
.error-msg { background: #fff2f0; border: 1px solid #ffccc7; color: #ff4d4f; padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
.success-msg { background: #f6ffed; border: 1px solid #b7eb8f; color: #52c41a; padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }

/* 后台布局 */
.sidebar { position: fixed; left: 0; top: 0; width: 220px; height: 100vh; background: linear-gradient(180deg, #667eea 0%, #764ba2 100%); color: #fff; overflow-y: auto; z-index: 100; }
.sidebar .logo { padding: 20px; font-size: 18px; font-weight: bold; border-bottom: 1px solid rgba(255,255,255,0.15); text-align: center; }
.sidebar nav { padding: 15px 0; }
.sidebar nav a { display: flex; align-items: center; padding: 12px 20px; color: rgba(255,255,255,0.85); font-size: 14px; transition: all 0.2s; }
.sidebar nav a:hover, .sidebar nav a.active { background: rgba(255,255,255,0.15); color: #fff; padding-left: 25px; }
.sidebar nav a .icon { margin-right: 10px; font-size: 16px; }
.sidebar nav a .arrow { margin-left: auto; font-size: 10px; transition: transform 0.2s; }
.sidebar nav a.open .arrow { transform: rotate(90deg); }

/* 子菜单（目录） */
.sidebar .submenu { background: rgba(0,0,0,0.12); display: none; }
.sidebar .submenu.open { display: block; }
.sidebar .submenu a { padding-left: 44px; font-size: 13px; }
.sidebar .submenu a.active { background: rgba(255,255,255,0.2); padding-left: 48px; }
.sidebar .dir-label { padding: 8px 20px 4px; font-size: 11px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.5px; pointer-events: none; }
.sidebar-badge { margin-left:auto; background:#ff4d4f; color:#fff; font-size:11px; font-weight:700; min-width:20px; height:20px; border-radius:10px; display:inline-flex; align-items:center; justify-content:center; padding:0 6px; animation:badge-pulse 2s infinite; }
@keyframes badge-pulse { 0%,100%{ transform:scale(1); } 50%{ transform:scale(1.15); } }

.main { margin-left: 220px; min-height: 100vh; background: #f0f2f5; }
.topbar { background: #fff; padding: 0 24px; height: 60px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #f0f0f0; position: sticky; top: 0; z-index: 50; }
.topbar .user-info { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.topbar .user-info .role-tag { background: #667eea; color: #fff; padding: 2px 10px; border-radius: 20px; font-size: 12px; }
.content { padding: 24px; }
.page-title { font-size: 20px; font-weight: 600; margin-bottom: 20px; color: #333; }
.page-title .subtitle { font-size: 13px; color: #999; font-weight: normal; margin-left: 10px; }

/* 卡片 */
.card { background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); margin-bottom: 20px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid #f0f0f0; display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 15px; }
.card-body { padding: 20px; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; }
.table th { background: #fafafa; padding: 12px 16px; text-align: left; font-weight: 500; color: #666; font-size: 13px; border-bottom: 1px solid #f0f0f0; white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid #f0f0f0; font-size: 14px; vertical-align: middle; }
.table tr:hover td { background: #fafafa; }
.table .actions { white-space: nowrap; }
.table .actions a, .table .actions button { display: inline-block; padding: 4px 10px; border-radius: 4px; font-size: 12px; line-height: 1; vertical-align: middle; cursor: pointer; border: none; text-decoration: none; }
.table .actions .btn-edit { background: #e6f7ff; color: #1890ff; }
.table .actions .btn-del { background: #fff1f0; color: #ff4d4f; }
.table .actions .btn-view { background: #f6ffed; color: #52c41a; }

/* 状态标签 */
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-success { background: #f6ffed; color: #52c41a; }
.badge-warning { background: #fffbe6; color: #faad14; }
.badge-danger { background: #fff1f0; color: #ff4d4f; }
.badge-info { background: #e6f7ff; color: #1890ff; }
.badge-default { background: #f5f5f5; color: #666; }

/* 统计卡片 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.stat-card .num { font-size: 28px; font-weight: 700; color: #667eea; }
.stat-card .label { color: #999; font-size: 13px; margin-top: 4px; }
.stat-card .sub { color: #52c41a; font-size: 12px; margin-top: 6px; }
.stat-card.danger .num { color: #ff4d4f; }

/* 分页+工具栏 */
.page-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.page-toolbar .left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-toolbar .right { display: flex; align-items: center; gap: 10px; }
.page-toolbar .info { font-size: 13px; color: #999; white-space: nowrap; }
.page-toolbar select { padding: 6px 10px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 13px; color: #666; }

/* 搜索栏 */
.search-bar { background: #fff; border-radius: 8px; padding: 16px 20px; margin-bottom: 16px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.search-bar .form-group { margin-bottom: 0; flex: 0 0 auto; min-width: 0; }
.search-bar label { font-size: 12px; color: #999; margin-bottom: 2px; display: block; }
.search-bar input, .search-bar select { padding: 6px 10px; font-size: 13px; width: 100%; border: 1px solid #d9d9d9; border-radius: 4px; }
.search-bar .btn { padding: 6px 16px 6px 16px; font-size: 13px; margin-top: 40px; }

/* 分页 */
.pagination-wrap { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; flex-wrap: wrap; gap: 12px; }
.pagination { display: flex; align-items: center; gap: 6px; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 13px; }
.pagination a { color: #666; }
.pagination a:hover { color: #1890ff; border-color: #1890ff; }
.pagination .active { background: #667eea; color: #fff; border-color: #667eea; }
.pagination .disabled { color: #d9d9d9; cursor: not-allowed; pointer-events: none; }

/* 表单工具栏 */
.filter-bar { background: #fff; border-radius: 8px; padding: 16px 20px; margin-bottom: 16px; display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.filter-bar .form-group { margin-bottom: 0; }
.filter-bar label { font-size: 12px; color: #999; margin-bottom: 2px; display: block; }
.filter-bar input, .filter-bar select { padding: 6px 10px; font-size: 13px; }

/* 响应式 */
@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar .logo span, .sidebar nav a span:not(.icon) { display: none; }
    .sidebar nav a { justify-content: center; padding: 12px; }
    .main { margin-left: 60px; }
    .stats { grid-template-columns: 1fr 1fr; }
}

/* 模态框 */
.modal-overlay { 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; }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: 10px; width: 90%; max-width: 560px; max-height: 85vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.modal-header { padding: 18px 24px; border-bottom: 1px solid #f0f0f0; font-weight: 600; font-size: 16px; display: flex; align-items: center; justify-content: space-between; }
.modal-header .close-btn { background: none; border: none; font-size: 20px; cursor: pointer; color: #999; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid #f0f0f0; display: flex; justify-content: flex-end; gap: 10px; }

/* 空状态 */
.empty-state { text-align: center; padding: 60px 20px; color: #999; }
.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state p { font-size: 14px; }

/* 收款标签 */
.paid-tag { color: #52c41a; font-weight: 600; }
.unpaid-tag { color: #ff4d4f; font-weight: 600; }
.partial-tag { color: #faad14; font-weight: 600; }
