/* 校园托管管理系统 - 管理后台样式 */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --sidebar-w: 240px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }

/* Login */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1e40af, #3b82f6); }
.login-box { background: #fff; border-radius: 16px; padding: 48px 40px; width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.15); }
.login-box h1 { font-size: 1.5em; text-align: center; margin-bottom: 8px; }
.login-box .subtitle { text-align: center; color: var(--text-light); margin-bottom: 32px; font-size: 0.9em; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.9em; font-weight: 500; margin-bottom: 6px; color: var(--text-light); }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.95em; transition: border-color 0.2s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; border: none; border-radius: 8px; font-size: 0.9em; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 0.82em; }
.btn-block { width: 100%; justify-content: center; padding: 12px; font-size: 1em; }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: #0f172a; color: #fff; position: fixed; top: 0; left: 0; bottom: 0; overflow-y: auto; z-index: 100; }
.sidebar-header { padding: 20px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-header h2 { font-size: 1.1em; font-weight: 600; }
.sidebar-header p { font-size: 0.78em; color: #94a3b8; margin-top: 4px; }
.sidebar-nav { padding: 12px 0; }
.sidebar-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: #cbd5e1; font-size: 0.9em; transition: all 0.15s; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: rgba(37,99,235,0.15); color: #fff; }
.sidebar-nav a.active { border-right: 3px solid var(--primary); }
.sidebar-nav .divider { height: 1px; background: rgba(255,255,255,0.06); margin: 8px 20px; }
.main { flex: 1; margin-left: var(--sidebar-w); }
.topbar { background: var(--card); border-bottom: 1px solid var(--border); padding: 12px 28px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; }
.topbar h1 { font-size: 1.2em; font-weight: 600; }
.content { padding: 24px 28px; }

/* Cards */
.card { background: var(--card); border-radius: 12px; border: 1px solid var(--border); padding: 24px; margin-bottom: 20px; }
.card-title { font-size: 1.05em; font-weight: 600; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--card); border-radius: 12px; border: 1px solid var(--border); padding: 20px; }
.stat-card .label { font-size: 0.85em; color: var(--text-light); }
.stat-card .value { font-size: 1.8em; font-weight: 700; margin-top: 4px; }
.stat-card .value.text-primary { color: var(--primary); }
.stat-card .value.text-success { color: var(--success); }
.stat-card .value.text-warning { color: var(--warning); }
.stat-card .value.text-danger { color: var(--danger); }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9em; }
thead th { background: #f8fafc; padding: 10px 14px; text-align: left; font-weight: 600; color: var(--text-light); border-bottom: 2px solid var(--border); white-space: nowrap; }
tbody td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
tbody tr:hover { background: #f8fafc; }

/* Badge */
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 0.78em; font-weight: 600; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1d4ed8; }
.badge-gray { background: #f1f5f9; color: #475569; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: 16px; padding: 28px; width: 520px; max-height: 85vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.modal h3 { font-size: 1.15em; margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* Toolbar */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input, .toolbar select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.9em; }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; }
.pagination button { padding: 6px 14px; border: 1px solid var(--border); border-radius: 6px; background: #fff; cursor: pointer; font-size: 0.85em; }
.pagination button:hover { background: var(--primary-light); }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Toast */
.toast { position: fixed; top: 20px; right: 20px; padding: 12px 24px; border-radius: 8px; color: #fff; font-size: 0.9em; z-index: 2000; animation: slideIn 0.3s ease; }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main { margin-left: 0; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .modal { width: 95%; margin: 0 10px; }
}
