/* ============================================================
   云护精灵 · 居家养老服务平台 — 后台样式
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
    font: 14px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    color: #333;
    background: #f0f2f5;
}
a { text-decoration: none; color: #1f7a68; }
a:hover { color: #2f9e8f; }

/* ---------- 整体布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 210px; flex-shrink: 0;
    background: #263445; color: #bfcbd9;
    display: flex; flex-direction: column;
}
.sidebar .brand {
    height: 60px; line-height: 60px; text-align: center;
    color: #fff; font-size: 17px; font-weight: bold; letter-spacing: 1px;
    background: #1f2a38;
}
.sidebar .brand span { display: block; line-height: 1; font-size: 11px; font-weight: normal; color: #8aa; margin-top: -14px; }
.sidebar nav { padding: 10px 0; flex: 1; }
.sidebar nav a {
    display: block; padding: 12px 24px; color: #bfcbd9; font-size: 14px;
    border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: #1f2a38; color: #fff; }
.sidebar nav a.active { background: #1f2a38; color: #2f9e8f; border-left-color: #2f9e8f; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    height: 60px; background: #fff; border-bottom: 1px solid #e8e8e8;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; flex-shrink: 0;
}
.topbar .crumb { color: #666; font-size: 14px; }
.content { flex: 1; padding: 20px 24px; }
.footer { padding: 14px 0; text-align: center; color: #999; font-size: 12px; }

/* ---------- 卡片 / 表格 ---------- */
.card { background: #fff; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.05); padding: 18px; margin-bottom: 18px; }
.card .card-title { font-size: 15px; font-weight: bold; margin-bottom: 14px; color: #333; }
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid #eee; text-align: left; font-size: 13px; white-space: nowrap; }
.table th { background: #fafafa; color: #666; font-weight: normal; }
.table td { color: #444; }
.table tr:hover td { background: #f7fbfa; }
.table .td-wrap { white-space: normal; min-width: 160px; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-block; padding: 7px 16px; border: 1px solid transparent; border-radius: 4px;
    font-size: 13px; cursor: pointer; background: #2f9e8f; color: #fff; border-color: #2f9e8f;
    line-height: 1.4;
}
.btn:hover { background: #2a8a7d; color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-plain { background: #fff; color: #555; border-color: #ddd; }
.btn-plain:hover { background: #f5f5f5; color: #333; }
.btn-danger { background: #e8635a; border-color: #e8635a; }
.btn-danger:hover { background: #d5544b; }
.btn-warn { background: #f0a641; border-color: #f0a641; }
.btn-warn:hover { background: #dd9839; }
.btn-blue { background: #4a90d9; border-color: #4a90d9; }
.btn-blue:hover { background: #3d81c8; }
.btn-ghost { background: transparent; border-color: #ddd; color: #666; }
.btn-ghost:hover { background: #f5f5f5; color: #333; }

/* ---------- 表单 ---------- */
.form-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.form-inline input[type="text"], .form-inline select, .form-inline input[type="date"] {
    padding: 7px 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 13px; outline: none;
    background: #fff;
}
.form-inline input:focus, .form-inline select:focus { border-color: #2f9e8f; }
.form-item { margin-bottom: 16px; }
.form-item label { display: block; margin-bottom: 6px; color: #555; font-size: 13px; }
.form-item label em { color: #e8635a; font-style: normal; margin-left: 2px; }
.form-item input[type="text"], .form-item input[type="password"], .form-item input[type="date"],
.form-item input[type="datetime-local"], .form-item input[type="number"],
.form-item select, .form-item textarea {
    width: 100%; padding: 9px 12px; border: 1px solid #ddd; border-radius: 4px;
    font-size: 13px; outline: none; background: #fff;
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: #2f9e8f; }
.form-item textarea { height: 70px; resize: vertical; }

/* ---------- 统计卡片 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stat-card { background: #fff; border-radius: 6px; padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.stat-card .num { font-size: 26px; font-weight: bold; color: #263445; }
.stat-card .num a { color: inherit; }
.stat-card .label { color: #999; font-size: 12px; margin-top: 2px; }
.stat-card.hl .num { color: #2f9e8f; }
.stat-card.warn .num { color: #f0a641; }
.stat-card.danger .num { color: #e8635a; }

/* ---------- 状态徽标 ---------- */
.tag { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; line-height: 1.7; }
.st-pending  { background: #fff4e5; color: #d9841e; }   /* 待派单 / 待审核 */
.st-dispatch { background: #e6f1fb; color: #3d81c8; }   /* 已派单 */
.st-accepted { background: #e5f6f8; color: #2a9dab; }   /* 已接单 */
.st-serving  { background: #fff9db; color: #b8860b; }   /* 服务中 */
.st-finish   { background: #f1e9fb; color: #7a4fb5; }   /* 待确认 */
.st-done     { background: #e3f5e1; color: #3a9d3f; }   /* 已完成 / 已入驻 */
.st-cancel   { background: #f5f5f5; color: #999; }      /* 已取消 / 已驳回 */

/* ---------- Tab ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid #eee; margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { padding: 8px 16px; color: #666; font-size: 13px; border-radius: 4px 4px 0 0; position: relative; }
.tabs a.active { color: #2f9e8f; font-weight: bold; background: #f2faf8; }
.tabs a .n { color: #e8635a; margin-left: 2px; }

/* ---------- 分页 ---------- */
.pagination { margin: 16px 0 0; display: flex; gap: 6px; flex-wrap: wrap; }
.pagination li { list-style: none; }
.pagination li a, .pagination li span {
    display: block; padding: 5px 11px; border: 1px solid #ddd; border-radius: 4px;
    color: #555; font-size: 13px; background: #fff;
}
.pagination li.active span { background: #2f9e8f; border-color: #2f9e8f; color: #fff; }
.pagination li.disabled span { color: #bbb; background: #fafafa; }

/* ---------- 弹窗 ---------- */
.modal-mask {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45);
    z-index: 100; align-items: flex-start; justify-content: center; overflow: auto; padding: 60px 20px;
}
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 8px; width: 560px; max-width: 96vw; box-shadow: 0 8px 30px rgba(0,0,0,.2); }
.modal .modal-hd { padding: 14px 20px; border-bottom: 1px solid #eee; font-size: 15px; font-weight: bold; display: flex; justify-content: space-between; align-items: center; }
.modal .modal-hd .close { cursor: pointer; color: #999; font-size: 20px; font-weight: normal; line-height: 1; }
.modal .modal-bd { padding: 20px; max-height: 65vh; overflow: auto; }
.modal .modal-ft { padding: 14px 20px; border-top: 1px solid #eee; text-align: right; }
.modal .modal-ft .btn { margin-left: 10px; }

/* ---------- 时间线 ---------- */
.timeline { position: relative; padding-left: 18px; }
.timeline .t-item { position: relative; padding: 0 0 18px 14px; border-left: 2px solid #e5e5e5; }
.timeline .t-item:last-child { border-left-color: transparent; }
.timeline .t-item::before {
    content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px;
    border-radius: 50%; background: #2f9e8f; box-shadow: 0 0 0 3px #e3f5e1;
}
.timeline .t-time { color: #999; font-size: 12px; }
.timeline .t-text { color: #444; font-size: 13px; margin-top: 2px; }
.timeline .t-text b { color: #263445; }

/* ---------- 详情信息网格 ---------- */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.info-grid .item { font-size: 13px; }
.info-grid .item .k { color: #999; margin-right: 8px; }
.info-grid .item.wide { grid-column: 1 / -1; }

/* ---------- 空数据 ---------- */
.empty { text-align: center; color: #bbb; padding: 40px 0; }

/* ---------- 登录页 ---------- */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #2f9e8f 0%, #263445 100%);
}
.login-box { width: 380px; background: #fff; border-radius: 10px; padding: 36px 34px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.login-box h1 { font-size: 20px; color: #263445; text-align: center; margin-bottom: 6px; }
.login-box .sub { text-align: center; color: #999; font-size: 12px; margin-bottom: 26px; }
.login-box .btn { width: 100%; padding: 10px; font-size: 14px; margin-top: 6px; }
.login-tip { margin-top: 18px; padding: 10px; background: #f7f9f8; border-radius: 6px; font-size: 12px; color: #8aa; line-height: 1.8; }

@media (max-width: 900px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .sidebar { width: 64px; }
    .sidebar .brand { font-size: 12px; }
    .sidebar .brand span { display: none; }
    .sidebar nav a { padding: 12px 0; text-align: center; font-size: 12px; }
}
