/* ===========================================================================
   iPMU Pro - Mobile Admin Styles
   命名空间: .ma-page
   暗色主题 · 移动优先 · 固定底部导航
   =========================================================================== */

/* --- 基础布局 --- */
.ma-page {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px 16px 80px;
    min-height: 100vh;
    background: #0f172a;
    color: #e2e8f0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* --- 头部 --- */
.ma-header {
    text-align: center;
    padding: 12px 0 16px;
    border-bottom: 1px solid #1e293b;
    margin-bottom: 16px;
}

.ma-header h1 {
    font-size: 18px;
    font-weight: 700;
    color: #f8fafc;
    margin: 0;
}

.ma-header .ma-subtitle {
    font-size: 12px;
    color: #64748b;
    margin: 4px 0 0;
}

/* --- 仪表盘计数卡片 --- */
.ma-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.ma-stat-card {
    background: #1e293b;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.ma-stat-card:hover {
    background: #334155;
    color: inherit;
    text-decoration: none;
}

.ma-stat-card .ma-stat-num {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.ma-stat-card .ma-stat-label {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

.ma-stat-num.payments { color: #f59e0b; }
.ma-stat-num.users { color: #3b82f6; }
.ma-stat-num.invoices { color: #10b981; }
.ma-stat-num.tools { color: #8b5cf6; }

/* --- 列表卡片 --- */
.ma-card {
    background: #1e293b;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
}

.ma-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ma-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #f8fafc;
}

.ma-card-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.ma-badge-pending {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.ma-badge-approved {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.ma-badge-rejected {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.ma-card-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 3px 0;
    color: #94a3b8;
}

.ma-card-row span:last-child {
    color: #e2e8f0;
    font-weight: 500;
}

/* --- 操作按钮 --- */
.ma-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.ma-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
    text-align: center;
}

.ma-btn-approve {
    background: #10b981;
    color: #fff;
}

.ma-btn-approve:hover {
    background: #059669;
}

.ma-btn-reject {
    background: #374151;
    color: #f87171;
}

.ma-btn-reject:hover {
    background: #4b5563;
}

.ma-btn-primary {
    background: #3b82f6;
    color: #fff;
}

.ma-btn-primary:hover {
    background: #2563eb;
}

.ma-btn-warning {
    background: #f59e0b;
    color: #fff;
}

.ma-btn-warning:hover {
    background: #d97706;
}

.ma-btn-danger {
    background: #ef4444;
    color: #fff;
}

.ma-btn-danger:hover {
    background: #dc2626;
}

.ma-btn-sm {
    min-height: 36px;
    padding: 0 12px;
    font-size: 13px;
}

/* --- 表单 --- */
.ma-form-group {
    margin-bottom: 14px;
}

.ma-form-group label {
    display: block;
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 6px;
}

.ma-input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 16px; /* 防 iOS 自动缩放 */
    box-sizing: border-box;
}

.ma-input:focus {
    outline: none;
    border-color: #3b82f6;
}

.ma-select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 16px;
    box-sizing: border-box;
    -webkit-appearance: none;
}

/* --- 提示消息 --- */
.ma-alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 12px;
}

.ma-alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.ma-alert-error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.ma-alert-info {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* --- 空状态 --- */
.ma-empty {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.ma-empty i {
    font-size: 40px;
    display: block;
    margin-bottom: 12px;
}

/* --- 固定底部导航 --- */
.ma-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #1e293b;
    border-top: 1px solid #334155;
    display: flex;
    justify-content: center;
    z-index: 1000;
}

.ma-bottom-nav-inner {
    display: flex;
    max-width: 480px;
    width: 100%;
}

.ma-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #64748b;
    font-size: 11px;
    padding: 6px 0;
    min-height: 44px;
}

.ma-nav-item i {
    font-size: 20px;
    margin-bottom: 2px;
}

.ma-nav-item.active {
    color: #3b82f6;
}

.ma-nav-item:hover {
    color: #94a3b8;
    text-decoration: none;
}

.ma-nav-item.active:hover {
    color: #3b82f6;
}

/* --- 分割线 --- */
.ma-divider {
    height: 1px;
    background: #1e293b;
    margin: 16px 0;
}

/* --- 页面标题 --- */
.ma-page-title {
    font-size: 16px;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 16px;
}

/* --- 用户搜索结果 --- */
.ma-user-info {
    background: #1e293b;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 16px;
}

.ma-user-info h3 {
    font-size: 15px;
    font-weight: 600;
    color: #f8fafc;
    margin: 0 0 8px;
}

/* --- 凭证图片 --- */
.ma-proof-img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    border: 1px solid #334155;
    margin-top: 8px;
}

/* --- Flash 消息置顶 --- */
.ma-flash-container {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #0f172a;
}

/* --- 仪表盘待办摘要 --- */
.ma-stat-summary {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
    line-height: 1.4;
}

/* --- iOS safe area --- */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .ma-bottom-nav {
        height: calc(60px + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
    }
    .ma-page {
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }
}
