/* ============================================================
 *  管理后台统一样式  assets/admin.css
 *  由原先 12 个页面各自复制的内联样式合并而来，并做视觉升级。
 *  页面通过 <link> 引入；类名与 mobile.css 抽屉导航保持兼容。
 * ============================================================ */

:root {
    --adm-dark-1: #1e293b;
    --adm-dark-2: #0f172a;
    --adm-accent: #3b82f6;
    --adm-accent-dark: #2563eb;
    --adm-text-dim: #94a3b8;
}

body {
    background-color: #f1f5f9;
}

/* ---------------- 侧边栏 ---------------- */
.sidebar {
    background: linear-gradient(180deg, var(--adm-dark-1) 0%, var(--adm-dark-2) 100%);
    color: white;
    min-height: 100vh;
    padding: 1.1rem 0.85rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar .brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.35rem 0.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.9rem;
}
.sidebar .brand-icon {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}
.sidebar .brand-name {
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.35;
    color: #f1f5f9;
    word-break: break-all;
}
.sidebar .brand-sub {
    font-size: 0.72rem;
    color: #64748b;
    letter-spacing: 0.15em;
}
.sidebar .nav-header {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    margin: 1rem 0.5rem 0.4rem;
    color: #64748b;
}
.sidebar a {
    color: #cbd5e1;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 0.62rem 0.75rem;
    border-radius: 0.6rem;
    margin-bottom: 0.15rem;
    font-size: 0.92rem;
    transition: background 0.15s ease, color 0.15s ease;
    border-left: 3px solid transparent;
}
.sidebar a:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}
.sidebar a.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.25), rgba(59, 130, 246, 0.08));
    color: #fff;
    border-left-color: #3b82f6;
    font-weight: 600;
}
.sidebar a .badge {
    margin-left: auto;
    font-size: 0.7rem;
    padding: 0.32em 0.6em;
}
.sidebar .sidebar-foot {
    margin-top: 1.2rem;
    padding: 0.65rem 0.75rem;
    font-size: 0.72rem;
    color: #475569;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ---------------- 页头 ---------------- */
.header {
    background-color: white;
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    margin-bottom: 1.25rem;
    border-radius: 12px;
}
.header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0;
}
.header .welcome {
    color: #64748b;
    font-size: 0.88rem;
    margin-bottom: 0;
}
.header .welcome strong { color: #1e293b; }

/* ---------------- 卡片 ---------------- */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}
.card-header {
    font-weight: 600;
    border-bottom: 1px solid #e9ecef;
}
.card-header.bg-primary { border-bottom: none; }

/* ---------------- 统计卡片 ---------------- */
.stat-card {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
}
.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex: 0 0 auto;
}
.stat-card .stat-icon.i-primary { background: #dbeafe; color: #2563eb; }
.stat-card .stat-icon.i-warning { background: #fef3c7; color: #d97706; }
.stat-card .stat-icon.i-info { background: #cffafe; color: #0891b2; }
.stat-card .stat-icon.i-success { background: #dcfce7; color: #16a34a; }
.stat-card .stat-icon.i-danger { background: #fee2e2; color: #dc2626; }
.stat-card .stat-icon.i-purple { background: #ede9fe; color: #7c3aed; }
.stat-card h3 {
    font-size: 1.7rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0;
    line-height: 1.1;
}
.stat-card h6 {
    font-size: 0.82rem;
    color: #64748b;
    margin-bottom: 0.15rem;
    font-weight: 600;
}

/* ---------------- 待办直达卡 ---------------- */
.todo-card {
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.todo-card:hover { transform: translateY(-3px); color: #fff; box-shadow: 0 8px 22px rgba(15, 23, 42, 0.2); }
.todo-card.t-warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
.todo-card.t-info { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.todo-card.t-danger { background: linear-gradient(135deg, #ef4444, #dc2626); }
.todo-card .todo-num { font-size: 2rem; font-weight: 800; line-height: 1; }
.todo-card .todo-label { font-size: 0.88rem; opacity: 0.92; }
.todo-card .todo-go { font-size: 0.8rem; opacity: 0.85; }

/* ---------------- 页脚 ---------------- */
.footer {
    background-color: transparent;
    color: #94a3b8;
    padding: 1.2rem 0 1.6rem;
    margin-top: 2rem;
    font-size: 0.82rem;
}

/* ---------------- 表格与列表 ---------------- */
.table thead th {
    font-size: 0.8rem;
    color: #64748b;
    text-transform: none;
    border-bottom-width: 1px;
}
.badge { font-weight: 600; padding: 0.42em 0.7em; }

/* ---------------- 各页特有 ---------------- */
/* 活动邀请 / 个人资料 的内容区 */
.main-content { padding: 2rem; }

/* 审批管理 */
.visitor-photo { max-width: 150px; border-radius: 10px; border: 2px solid #dee2e6; }

/* 审批日志 */
.log-entry { border-bottom: 1px solid #dee2e6; }
.log-entry:last-child { border-bottom: none; }
.log-time { color: #6c757d; font-size: 0.875rem; }

/* 系统设置 */
.logo-preview { max-width: 200px; border-radius: 10px; border: 2px solid #dee2e6; }

/* 个人资料 */
.error-message { color: #dc3545; font-size: 0.875rem; margin-top: 0.25rem; }
.success-message { color: #28a745; font-size: 0.875rem; margin-top: 0.25rem; }

/* ---------------- 手机端：后台表格横向滑动而非挤压 ---------------- */
@media (max-width: 767.98px) {
    .admin-body table.table { min-width: 620px; }
}

/* ---------------- 登录页 ---------------- */
.login-body {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 55%, #1e3a5f 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0));
}
.login-card {
    background: white;
    padding: 2.2rem 2rem;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    width: 100%;
    max-width: 400px;
}
.login-header { text-align: center; margin-bottom: 1.8rem; }
.login-header .login-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 18px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.8rem;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.45);
}
.login-header h2 { color: #0f172a; font-weight: 700; font-size: 1.35rem; }
.login-header p { color: #64748b; font-size: 0.9rem; margin-bottom: 0; }

/* ---------------- 桌面窄屏 ---------------- */
@media (min-width: 768px) and (max-width: 991.98px) {
    .sidebar .brand-name { font-size: 0.85rem; }
}
