/* ===== admin/admin.css — 管理端 PC Web 样式 ===== */

/* ── 布局骨架 ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif; background: #f1f5f9; color: #1e293b; min-height: 100vh; display: flex; flex-direction: column; }

.admin-layout { display: flex; min-height: 100vh; }

/* ── 顶栏 ── */
.admin-topbar { position: fixed; top: 0; left: 0; right: 0; height: 56px; background: #fff; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; z-index: 100; padding: 0 20px; gap: 16px; }
.topbar-logo { display: flex; align-items: center; gap: 10px; width: 220px; flex-shrink: 0; }
.topbar-logo .logo-icon { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, #1a3a6e, #0088d1); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 16px; }
.topbar-logo .logo-text { font-size: 15px; font-weight: 700; color: #1a3a6e; }
.topbar-search { flex: 1; max-width: 360px; position: relative; }
.topbar-search input { width: 100%; padding: 7px 14px 7px 36px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 13px; background: #f8fafc; outline: none; }
.topbar-search input:focus { border-color: #1a3a6e; background: #fff; }
.topbar-search .search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 14px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.topbar-notif { position: relative; cursor: pointer; color: #64748b; font-size: 20px; }
.topbar-notif .badge { position: absolute; top: -3px; right: -5px; width: 16px; height: 16px; border-radius: 50%; background: #e53e3e; color: #fff; font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.topbar-user { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.topbar-user:hover { background: #f1f5f9; }
.topbar-user .avatar { width: 30px; height: 30px; border-radius: 50%; background: #1a3a6e; color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.topbar-user .name { font-size: 13px; color: #374151; }

/* ── 侧边栏 ── */
.admin-sidebar { width: 220px; position: fixed; top: 56px; left: 0; bottom: 0; background: #fff; border-right: 1px solid #e2e8f0; overflow-y: auto; padding: 12px 0; z-index: 50; flex-shrink: 0; }
.sidebar-section { margin-bottom: 4px; }
.sidebar-section-label { font-size: 11px; font-weight: 600; color: #94a3b8; letter-spacing: 0.5px; text-transform: uppercase; padding: 8px 20px 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 20px; font-size: 14px; color: #475569; cursor: pointer; border-radius: 0; text-decoration: none; transition: all 0.15s; }
.nav-item:hover { background: #f8fafc; color: #1a3a6e; }
.nav-item.active { background: #e8f0fb; color: #1a3a6e; font-weight: 600; border-right: 3px solid #1a3a6e; }
.nav-item .ni-icon { font-size: 16px; width: 20px; text-align: center; }
.nav-badge { margin-left: auto; background: #e53e3e; color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 999px; font-weight: 700; }

/* ── 主内容区 ── */
.admin-main { margin-left: 220px; margin-top: 56px; padding: 24px; flex: 1; min-width: 0; }

/* ── 页面标题 ── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-header h1 { font-size: 22px; font-weight: 700; color: #0f172a; }
.page-header .breadcrumb { font-size: 12px; color: #94a3b8; margin-top: 3px; }

/* ── KPI 卡片 ── */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 1200px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.kpi-card { background: #fff; border-radius: 12px; padding: 20px; border: 1px solid #e2e8f0; }
.kpi-card .kc-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.kpi-card .kc-label { font-size: 13px; color: #64748b; }
.kpi-card .kc-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.kpi-card .kc-val { font-size: 28px; font-weight: 700; color: #0f172a; }
.kpi-card .kc-change { font-size: 12px; color: #64748b; margin-top: 6px; }
.kpi-card .kc-change span { font-weight: 600; }
.kpi-card .kc-change span.up { color: #16a34a; }
.kpi-card .kc-change span.down { color: #dc2626; }

/* ── 数据表格 ── */
.table-card { background: #fff; border-radius: 12px; border: 1px solid #e2e8f0; overflow: hidden; }
.tc-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #f1f5f9; }
.tc-title { font-size: 15px; font-weight: 600; color: #0f172a; }
.tc-actions { display: flex; gap: 10px; align-items: center; }
table.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 600; color: #64748b; background: #f8fafc; border-bottom: 1px solid #e2e8f0; text-transform: uppercase; letter-spacing: 0.4px; white-space: nowrap; }
.data-table td { padding: 13px 16px; font-size: 13px; color: #374151; border-bottom: 1px solid #f1f5f9; white-space: nowrap; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f8fafc; }

/* ── 通用组件 ── */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge-green  { background: #dcfce7; color: #166534; }
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-gray   { background: #f1f5f9; color: #475569; }
.badge-gold   { background: #fef3c7; color: #92400e; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; font-size: 13px; cursor: pointer; border: none; transition: all 0.15s; font-family: inherit; }
.btn-primary-admin { background: #1a3a6e; color: #fff; }
.btn-primary-admin:hover { background: #0d2147; }
.btn-outline-admin { background: #fff; color: #1a3a6e; border: 1px solid #1a3a6e; }
.btn-outline-admin:hover { background: #e8f0fb; }
.btn-sm-admin { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-danger-admin { background: #fff; color: #dc2626; border: 1px solid #dc2626; }

.filter-bar { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid #f1f5f9; flex-wrap: wrap; }
.filter-bar input, .filter-bar select { padding: 7px 12px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 13px; background: #f8fafc; outline: none; font-family: inherit; }
.filter-bar input:focus, .filter-bar select:focus { border-color: #1a3a6e; background: #fff; }
.filter-bar input[type="text"] { min-width: 200px; }

.pagination { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid #f1f5f9; }
.pg-btn { width: 32px; height: 32px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 13px; cursor: pointer; background: #fff; border: 1px solid #e2e8f0; color: #374151; }
.pg-btn.active { background: #1a3a6e; color: #fff; border-color: #1a3a6e; }
.pg-btn:hover:not(.active) { background: #f1f5f9; }
.pg-info { font-size: 12px; color: #64748b; margin-left: auto; }

/* ── 双列布局 ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }

/* ── 时间线 / 动态列表 ── */
.timeline-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f1f5f9; }
.timeline-item:last-child { border-bottom: none; }
.tl-dot { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.tl-body { flex: 1; min-width: 0; }
.tl-title { font-size: 13px; font-weight: 500; color: #1f2937; }
.tl-desc { font-size: 12px; color: #64748b; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-time { font-size: 11px; color: #9ca3af; margin-top: 4px; }

/* ── 空状态 ── */
.empty-state-admin { text-align: center; padding: 48px 20px; color: #94a3b8; }
.empty-state-admin .es-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state-admin .es-text { font-size: 14px; }

/* ── 快速操作按钮组 ── */
.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.qa-btn { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 16px 12px; text-align: center; cursor: pointer; transition: all 0.15s; color: #374151; font-size: 13px; }
.qa-btn:hover { border-color: #1a3a6e; color: #1a3a6e; background: #e8f0fb; }
.qa-btn .qa-icon { font-size: 22px; margin-bottom: 6px; }
