:root {
    --primary: #2563eb;
    --primary-light: #dbeafe;
    --primary-dark: #1e40af;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --info: #0891b2;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --sidebar-width: 240px;
}

body {
    background: var(--gray-100);
    font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
}

/* ====== 侧边栏 ====== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e3a5f 0%, #15293d 100%);
    color: #cbd5e1;
    z-index: 1000;
    transition: transform 0.3s;
}

.sidebar-brand {
    padding: 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand .icon {
    font-size: 28px;
    color: #60a5fa;
}

.sidebar-brand h5 {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

.sidebar-brand small {
    color: #94a3b8;
    font-size: 11px;
}

.sidebar-menu {
    padding: 12px 0;
    list-style: none;
    margin: 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.sidebar-menu a:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

.sidebar-menu a.active {
    background: rgba(96,165,250,0.12);
    color: #60a5fa;
    border-left-color: #60a5fa;
}

.sidebar-menu .bi {
    font-size: 18px;
    width: 22px;
    text-align: center;
}

/* ====== 主内容区 ====== */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 20px 28px;
    min-height: 100vh;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header h4 {
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

/* ====== 统计卡片 ====== */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: transform 0.15s, box-shadow 0.15s;
    border: 1px solid var(--gray-200);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1;
    margin-top: 8px;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ====== 卡片面板 ====== */
.panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid var(--gray-200);
    margin-bottom: 20px;
}

.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-header h6 {
    margin: 0;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 15px;
}

.panel-body {
    padding: 20px;
}

/* ====== 状态标签 ====== */
.badge-status {
    font-size: 12px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 20px;
}

.status-active { background: #dcfce7; color: #15803d; }
.status-lost { background: #fee2e2; color: #b91c1c; }
.status-transferred { background: #fef3c7; color: #b45309; }
.status-deceased { background: #f3f4f6; color: #4b5563; }

.plan-pending { background: #dbeafe; color: #1d4ed8; }
.plan-overdue { background: #fee2e2; color: #b91c1c; }
.plan-completed { background: #dcfce7; color: #15803d; }

.severity-mild { background: #dcfce7; color: #15803d; }
.severity-moderate { background: #fef3c7; color: #b45309; }
.severity-severe { background: #fee2e2; color: #b91c1c; }

/* ====== 表格 ====== */
.table {
    margin-bottom: 0;
}

.table thead th {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--gray-200);
    padding: 12px 16px;
    background: var(--gray-50);
}

.table tbody td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background: var(--gray-50);
}

/* ====== 按钮 ====== */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    font-weight: 500;
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* ====== 时间线 ====== */
.timeline {
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--gray-200);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gray-300);
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--gray-300);
}

.timeline-item.completed::before {
    background: var(--success);
    box-shadow: 0 0 0 1px var(--success);
}

.timeline-item.overdue::before {
    background: var(--danger);
    box-shadow: 0 0 0 1px var(--danger);
}

.timeline-item.pending::before {
    background: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.timeline-date {
    font-size: 12px;
    color: var(--gray-500);
}

.timeline-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
}

.timeline-desc {
    font-size: 13px;
    color: var(--gray-500);
}

/* ====== 家长端样式 ====== */
.parent-page {
    max-width: 500px;
    margin: 0 auto;
    padding: 16px;
    background: var(--gray-50);
    min-height: 100vh;
}

.parent-header {
    text-align: center;
    padding: 24px 0 16px;
}

.parent-header .logo {
    font-size: 40px;
    color: var(--primary);
}

.parent-header h5 {
    font-weight: 600;
    color: var(--gray-800);
    margin-top: 8px;
}

.parent-header p {
    color: var(--gray-500);
    font-size: 13px;
    margin: 4px 0 0;
}

.parent-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.parent-card h6 {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-100);
}

.parent-info-box {
    background: var(--primary-light);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    color: var(--primary-dark);
    margin-bottom: 16px;
}

.form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: 4px;
}

.form-control, .form-select {
    font-size: 14px;
    border-color: var(--gray-300);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* ====== 提醒框 ====== */
.alert-overdue {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
}

.alert-pending {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
}

/* ====== 搜索栏 ====== */
.search-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.search-bar .form-control,
.search-bar .form-select {
    max-width: 220px;
}

/* ====== 模态框增强 ====== */
.modal-header {
    border-bottom: 1px solid var(--gray-200);
}

.modal-title {
    font-weight: 600;
}

.modal-body {
    padding: 20px;
}

/* ====== 空状态 ====== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-500);
}

.empty-state .bi {
    font-size: 48px;
    margin-bottom: 12px;
    color: var(--gray-300);
}

/* ====== 二维码区域 ====== */
.qr-area {
    text-align: center;
    padding: 16px;
}

.qr-area img {
    max-width: 200px;
    border-radius: 8px;
}

/* ====== 响应式 ====== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
}
