/* ===== 中恩养老管理后台 ===== */
:root {
    --brand: #1F3A52;
    --brand-deep: #152A3E;
    --accent: #E8862E;
    --bg: #F4F6F9;
    --card: #FFFFFF;
    --text: #22303E;
    --text-sub: #7C8794;
    --line: #E6EBF0;
    --green: #2E9E5B;
    --red: #C0392B;
    --blue: #2E6DA4;
    --radius: 12px;
    --shadow: 0 2px 12px rgba(31, 58, 82, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}
.hidden { display: none !important; }

/* ===== 登录页 ===== */
.login-view {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(900px 480px at 15% -10%, rgba(232, 134, 46, 0.14), transparent 60%),
        radial-gradient(800px 460px at 105% 110%, rgba(46, 109, 164, 0.22), transparent 55%),
        linear-gradient(160deg, #14283A 0%, var(--brand) 60%, #24466A 100%);
    padding: 24px;
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--card);
    border-radius: 20px;
    padding: 40px 34px 32px;
    box-shadow: 0 24px 64px rgba(6, 18, 30, 0.45);
}
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.login-logo, .side-logo {
    width: 52px; height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), #F0A558);
    color: #fff; font-size: 25px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(232, 134, 46, 0.35);
}
.login-title { font-size: 21px; font-weight: 700; color: var(--brand); letter-spacing: .5px; }
.login-sub { font-size: 13px; color: var(--text-sub); margin-top: 3px; }
.login-footer { color: rgba(255,255,255,0.55); font-size: 12px; margin-top: 24px; letter-spacing: 1px; }
.login-tip { text-align: center; color: var(--text-sub); font-size: 12px; margin-top: 14px; line-height: 1.7; }

.deny-icon { font-size: 48px; text-align: center; margin-bottom: 12px; }
.deny-title { font-size: 18px; font-weight: 700; text-align: center; margin-bottom: 8px; }
.deny-desc { color: var(--text-sub); font-size: 13px; text-align: center; line-height: 1.7; margin-bottom: 14px; }
.deny-uid {
    background: var(--bg); border-radius: 8px; padding: 12px;
    font-size: 12px; word-break: break-all; color: var(--brand);
    margin-bottom: 18px; user-select: all;
}

/* ===== 表单 ===== */
.field-label { display: block; font-size: 13px; color: var(--text-sub); margin: 14px 0 6px; }
.field-input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    outline: none;
    transition: border-color .15s;
}
.field-input:focus { border-color: var(--accent); }
.field-error { color: var(--red); font-size: 12px; min-height: 18px; margin-top: 4px; }
.code-row { display: flex; gap: 10px; }
.code-row .field-input { flex: 1; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-row { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 14px; }

.btn {
    border: none; border-radius: 8px;
    padding: 10px 18px;
    font-size: 14px; font-family: inherit;
    cursor: pointer;
    transition: opacity .15s, background .15s;
}
.btn:active { opacity: .85; }
.btn-primary { background: var(--accent); color: #fff; font-weight: 600; }
.btn-outline { background: #fff; border: 1px solid var(--line); color: var(--text); }
.btn-ghost { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.85); }
.btn-block { width: 100%; margin-top: 16px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-danger { background: var(--red); color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ===== 主框架 ===== */
.app { display: flex; min-height: 100vh; }
.sidebar {
    width: 230px;
    background: linear-gradient(180deg, var(--brand-deep), var(--brand));
    color: #fff;
    display: flex; flex-direction: column;
    position: fixed; top: 0; bottom: 0; left: 0;
    z-index: 30;
}
.side-brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px; }
.side-logo { width: 40px; height: 40px; font-size: 20px; }
.side-title { font-size: 16px; font-weight: 700; }
.side-sub { font-size: 11px; color: rgba(255,255,255,0.55); margin-top: 2px; }
.side-nav { flex: 1; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 14px;
    transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active { background: var(--accent); color: #fff; font-weight: 600; }
.nav-icon { font-size: 16px; }
.nav-badge {
    margin-left: auto;
    background: var(--red); color: #fff;
    font-size: 11px; line-height: 18px;
    min-width: 18px; text-align: center;
    border-radius: 9px; padding: 0 5px;
}
.side-footer { padding: 16px; border-top: 1px solid rgba(255,255,255,0.1); }
.staff-info { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.staff-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--accent); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 600;
}
.staff-name { font-size: 14px; font-weight: 600; }
.staff-role { font-size: 11px; color: rgba(255,255,255,0.55); }

.main { flex: 1; margin-left: 230px; padding: 20px 24px 40px; }
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.topbar-title { flex: 1; font-size: 20px; font-weight: 700; color: var(--brand); }
.menu-toggle { display: none; border: none; background: none; font-size: 22px; color: var(--brand); cursor: pointer; }

/* ===== 看板 ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
    background: var(--card); border-radius: 16px;
    padding: 20px 18px; box-shadow: var(--shadow);
    display: flex; align-items: center; gap: 14px;
    transition: transform .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(31, 58, 82, 0.13); }
.stat-icon {
    width: 48px; height: 48px; border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}
.stat-label { font-size: 13px; color: var(--text-sub); }
.stat-value { font-size: 26px; font-weight: 700; color: var(--brand); margin-top: 2px; }
.stat-extra { font-size: 12px; color: var(--text-sub); margin-top: 4px; }

.panel {
    background: var(--card); border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 20px; margin-bottom: 20px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-title { font-size: 16px; font-weight: 700; color: var(--brand); }
.panel-link { font-size: 13px; color: var(--accent); text-decoration: none; }
.hint { color: #8a94a6; font-size: 13px; margin-top: 12px; line-height: 1.8; }

.chart { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding-top: 10px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart-bar {
    width: 70%; max-width: 42px;
    background: linear-gradient(180deg, var(--accent), #F0A558);
    border-radius: 6px 6px 0 0;
    min-height: 4px;
    transition: height .3s;
}
.chart-num { font-size: 12px; color: var(--brand); font-weight: 600; }
.chart-day { font-size: 11px; color: var(--text-sub); }

/* ===== 订单 ===== */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
    padding: 7px 16px; border-radius: 999px;
    background: #fff; border: 1px solid var(--line);
    font-size: 13px; cursor: pointer; color: var(--text-sub);
}
.tab.active { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }
.search-input { max-width: 260px; }

.order-list { display: flex; flex-direction: column; }
.order-row {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 8px;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    transition: background .12s;
}
.order-row:hover { background: #FAFBFD; }
.order-row:last-child { border-bottom: none; }
.order-main { flex: 1; min-width: 0; }
.order-title { font-size: 15px; font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.order-meta { font-size: 12px; color: var(--text-sub); margin-top: 4px; line-height: 1.6; }
.order-amount { font-size: 16px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.order-actions { display: flex; gap: 8px; flex-shrink: 0; }
.empty-tip { text-align: center; color: var(--text-sub); padding: 40px 0; font-size: 13px; }

.pill { font-size: 11px; padding: 3px 10px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.pill-pending { background: #FDEEDD; color: #B4650F; }
.pill-serving { background: #E3F0E9; color: var(--green); }
.pill-completed { background: #E8EEF5; color: var(--blue); }
.pill-cancelled { background: #F3E6E4; color: var(--red); }

/* ===== 抽屉 / 弹窗 ===== */
.drawer-mask {
    position: fixed; inset: 0;
    background: rgba(21, 42, 62, 0.45);
    z-index: 50;
    display: flex; justify-content: flex-end;
}
.drawer {
    width: 440px; max-width: 94vw;
    background: #fff; height: 100%;
    display: flex; flex-direction: column;
    box-shadow: -8px 0 32px rgba(0,0,0,0.15);
}
.drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px; border-bottom: 1px solid var(--line);
}
.drawer-title { font-size: 17px; font-weight: 700; color: var(--brand); }
.drawer-close { border: none; background: none; font-size: 18px; cursor: pointer; color: var(--text-sub); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-foot {
    display: flex; gap: 10px;
    padding: 16px 20px; border-top: 1px solid var(--line);
}
.foot-spacer { flex: 1; }
.modal {
    width: 520px; max-width: 94vw;
    background: #fff; border-radius: 14px;
    margin: auto;
    display: flex; flex-direction: column;
    max-height: 90vh;
}
.modal-body { padding: 8px 20px; overflow-y: auto; }
.modal .drawer-head { border-radius: 14px 14px 0 0; }
.modal .drawer-foot { border-radius: 0 0 14px 14px; }

.detail-row { display: flex; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.detail-label { width: 84px; color: var(--text-sub); flex-shrink: 0; }
.detail-value { flex: 1; word-break: break-all; }
.detail-items { margin: 10px 0; }
.detail-item {
    display: flex; justify-content: space-between;
    padding: 8px 12px; background: var(--bg);
    border-radius: 8px; margin-bottom: 6px; font-size: 13px;
}
.detail-sign {
    margin-top: 12px; border: 1px solid var(--line);
    border-radius: 10px; padding: 12px; text-align: center;
}
.detail-sign img { max-width: 100%; max-height: 220px; }
.sign-tip { font-size: 12px; color: var(--text-sub); margin-top: 8px; }

/* ===== 服务 / 套餐 ===== */
.svc-row {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 8px; border-bottom: 1px solid var(--line);
}
.svc-row:last-child { border-bottom: none; }
.svc-main { flex: 1; min-width: 0; }
.svc-name { font-size: 14px; font-weight: 600; }
.svc-meta { font-size: 12px; color: var(--text-sub); margin-top: 3px; }
.svc-price { font-size: 15px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.svc-off { opacity: .45; }
.switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { display: none; }
.switch .slider {
    position: absolute; inset: 0;
    background: #CBD5DE; border-radius: 999px;
    transition: background .2s; cursor: pointer;
}
.switch .slider::after {
    content: ''; position: absolute;
    width: 18px; height: 18px; border-radius: 50%;
    background: #fff; top: 3px; left: 3px;
    transition: left .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::after { left: 21px; }

.pkg-card {
    border: 1px solid var(--line); border-radius: 12px;
    padding: 16px; margin-bottom: 14px;
}
.pkg-head { display: flex; align-items: center; gap: 12px; }
.pkg-name { font-size: 15px; font-weight: 700; color: var(--brand); flex: 1; }
.pkg-price { font-size: 18px; font-weight: 700; color: var(--accent); }
.pkg-items { font-size: 12px; color: var(--text-sub); margin-top: 8px; line-height: 1.8; }
.pkg-foot { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.pkg-foot .field-input { max-width: 140px; padding: 6px 10px; }

/* ===== Toast ===== */
.toast {
    position: fixed; top: 24px; left: 50%;
    transform: translateX(-50%);
    background: var(--brand); color: #fff;
    padding: 10px 22px; border-radius: 999px;
    font-size: 14px; z-index: 99;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

/* ===== 手机适配 ===== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform .25s; }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; padding: 16px 14px 32px; }
    .menu-toggle { display: block; }
    .order-row { flex-wrap: wrap; }
    .order-actions { width: 100%; justify-content: flex-end; }
}

/* 登录方式切换 Tab */
.login-tabs { display: flex; gap: 6px; margin-top: 4px; background: #F1F4F8; border-radius: 12px; padding: 4px; }
.login-tab { flex: 1; border: none; background: transparent; padding: 10px 0; border-radius: 9px; font-size: 14px; color: #7C8794; cursor: pointer; font-family: inherit; transition: all .15s; }
.login-tab.active { background: #ffffff; color: var(--brand); font-weight: 600; box-shadow: 0 2px 8px rgba(31,58,82,0.14); }

/* ===== 账号管理 ===== */
.staff-avatar2 {
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, #2E6DA4, #4A8BC4);
    color: #fff; font-size: 15px; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.pill-admin { background: #FDEEDD; color: #B4650F; }
.pill-staff { background: #E8EEF5; color: var(--blue); }
#staffList .svc-row { padding: 15px 8px; }

/* ===== 媒体上传 ===== */
.media-field { display: flex; gap: 8px; align-items: center; }
.media-field .field-input { flex: 1; }
.media-preview {
    display: block;
    max-width: 100%;
    max-height: 180px;
    border-radius: 10px;
    margin-top: 8px;
    background: #f2f4f8;
    object-fit: contain;
}
.media-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.field-hint { margin-top: 6px; font-size: 12px; color: #8a93a6; line-height: 1.5; }
.media-cell { position: relative; width: 72px; height: 72px; border-radius: 8px; overflow: hidden; background: #f2f4f8; }
.media-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-del {
    position: absolute; top: 2px; right: 2px;
    width: 20px; height: 20px; border: none; border-radius: 50%;
    background: rgba(0,0,0,0.55); color: #fff; font-size: 11px; line-height: 20px;
    cursor: pointer; padding: 0;
}
.row-thumb {
    width: 44px; height: 44px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f2f4f8;
}
