/* 【文件说明】public\assets\css\app.css —— 后台样式表：布局、表格、表单、卡片、响应式 */
/* ============ 遇见你 · 智慧租房管理系统 主题样式 ============ */
:root {
    --yj-primary: #0d6b5f;
    --yj-primary-dark: #0a544a;
    --yj-primary-light: #e6f4f1;
    --yj-accent: #d9822b;
    --yj-sidebar: #12212b;
    --yj-sidebar-2: #172b37;
    --yj-text: #22313f;
    --yj-muted: #6b7c8c;
    --yj-border: #e3e9ef;
    --yj-bg: #f4f6f9;
    --yj-radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    color: var(--yj-text);
    background: var(--yj-bg);
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; }
a:hover { text-decoration: none; }

/* ---------- 侧边栏 ---------- */
.yj-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 228px;
    background: linear-gradient(180deg, var(--yj-sidebar) 0%, var(--yj-sidebar-2) 100%);
    overflow-y: auto;
    z-index: 1030;
    transition: transform .25s ease;
    scrollbar-width: thin;
}
.yj-sidebar::-webkit-scrollbar { width: 6px; }
.yj-sidebar::-webkit-scrollbar-thumb { background: #33475a; border-radius: 3px; }

.yj-logo {
    display: flex; align-items: center; gap: 10px;
    padding: 18px 18px 16px;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.yj-logo .mark {
    width: 34px; height: 34px; border-radius: 9px;
    background: linear-gradient(135deg, #17a08d, #0d6b5f);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 16px; color: #fff;
    box-shadow: 0 4px 12px rgba(23,160,141,.35);
}
.yj-logo .txt strong { display: block; font-size: 15px; letter-spacing: .5px; }
.yj-logo .txt small { color: rgba(255,255,255,.5); font-size: 11px; }

.yj-nav { padding: 10px 0 40px; }
.yj-nav .group-title {
    color: rgba(255,255,255,.38);
    font-size: 11px;
    letter-spacing: 1.5px;
    padding: 14px 20px 6px;
    text-transform: uppercase;
}
.yj-nav .nav-item-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 20px;
    color: rgba(255,255,255,.72);
    font-size: 13.5px;
    border-left: 3px solid transparent;
    transition: .18s;
}
.yj-nav .nav-item-link i { font-size: 15px; width: 18px; opacity: .85; }
.yj-nav .nav-item-link:hover { color: #fff; background: rgba(255,255,255,.05); }
.yj-nav .nav-item-link.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(23,160,141,.28), rgba(23,160,141,.06));
    border-left-color: #17a08d;
    font-weight: 600;
}

/* ---------- 主区域 ---------- */
.yj-main { margin-left: 228px; min-height: 100vh; display: flex; flex-direction: column; }

.yj-topbar {
    height: 60px;
    background: #fff;
    border-bottom: 1px solid var(--yj-border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 22px;
    position: sticky; top: 0; z-index: 1020;
}
.yj-topbar .left { display: flex; align-items: center; gap: 14px; }
.yj-topbar .page-title { font-size: 15px; font-weight: 600; margin: 0; }
.yj-topbar .breadcrumb-mini { color: var(--yj-muted); font-size: 12px; }
.yj-topbar .right { display: flex; align-items: center; gap: 16px; }
.topbar-icon {
    position: relative;
    color: var(--yj-muted); font-size: 17px;
    width: 34px; height: 34px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #f4f6f9;
}
.topbar-icon:hover { color: var(--yj-primary); background: var(--yj-primary-light); }
.topbar-icon .dot {
    position: absolute; top: 6px; right: 7px;
    width: 7px; height: 7px; border-radius: 50%; background: #e25555;
}
.user-chip { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.user-chip .avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, #17a08d, #0d6b5f);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600;
}
.user-chip .meta b { display: block; font-size: 13px; line-height: 1.2; }
.user-chip .meta span { font-size: 11px; color: var(--yj-muted); }

.yj-content { padding: 20px 22px 40px; flex: 1; }

.yj-footer { padding: 12px 22px; color: var(--yj-muted); font-size: 12px; border-top: 1px solid var(--yj-border); background: #fff; }

/* ---------- 卡片 ---------- */
.yj-card {
    background: #fff;
    border: 1px solid var(--yj-border);
    border-radius: var(--yj-radius);
    box-shadow: 0 1px 2px rgba(18,33,43,.04);
    margin-bottom: 18px;
    overflow: hidden;
}
.yj-card .card-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--yj-border);
    gap: 12px; flex-wrap: wrap;
}
.yj-card .card-head h6 { margin: 0; font-weight: 600; font-size: 14.5px; }
.yj-card .card-head .sub { color: var(--yj-muted); font-size: 12px; margin-top: 3px; }
.yj-card .card-body-pad { padding: 18px; }

/* ---------- 统计卡 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat-card {
    background: #fff; border: 1px solid var(--yj-border); border-radius: var(--yj-radius);
    padding: 16px 18px; position: relative; overflow: hidden;
    box-shadow: 0 1px 2px rgba(18,33,43,.04);
    transition: transform .18s, box-shadow .18s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(18,33,43,.08); }
.stat-card .label { color: var(--yj-muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.stat-card .value { font-size: 26px; font-weight: 700; margin-top: 6px; letter-spacing: -.5px; }
.stat-card .value small { font-size: 13px; font-weight: 500; color: var(--yj-muted); margin-left: 3px; }
.stat-card .foot { font-size: 12px; color: var(--yj-muted); margin-top: 6px; }
.stat-card .ico {
    position: absolute; right: 14px; top: 14px;
    width: 38px; height: 38px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; background: var(--yj-primary-light); color: var(--yj-primary);
}
.stat-card.teal .ico { background:#e6f4f1; color:#0d6b5f; }
.stat-card.orange .ico { background:#fdf1e3; color:#c5751f; }
.stat-card.blue .ico { background:#e8f0fb; color:#2a6fbb; }
.stat-card.red .ico { background:#fdeaea; color:#c0392b; }
.stat-card.purple .ico { background:#efeaf9; color:#6f4fb0; }
.stat-card.gray .ico { background:#eef1f4; color:#5b6b7a; }

/* ---------- 表格 ---------- */
.yj-table { margin: 0; font-size: 13.5px; }
.yj-table thead th {
    background: #f8fafb;
    color: #55677a;
    font-weight: 600;
    font-size: 12.5px;
    border-bottom: 1px solid var(--yj-border) !important;
    padding: 10px 14px;
    white-space: nowrap;
}
.yj-table tbody td { padding: 11px 14px; vertical-align: middle; border-color: #f0f3f6 !important; }
.yj-table tbody tr:hover { background: #fafcfd; }
.yj-table .num { font-variant-numeric: tabular-nums; }
.table-actions { white-space: nowrap; }
.table-actions .btn { --bs-btn-padding-y: .16rem; --bs-btn-padding-x: .45rem; --bs-btn-font-size: .78rem; }

.empty-state { padding: 50px 20px; text-align: center; color: #9aa9b7; }
.empty-state i { font-size: 34px; display: block; margin-bottom: 10px; opacity: .5; }

/* ---------- 徽标 ---------- */
.badge { font-weight: 500; padding: .38em .6em; border-radius: 5px; font-size: 12px; }
.badge-green { background: #e3f4ec; color: #0f7a55; }
.badge-red { background: #fdeaea; color: #c0392b; }
.badge-orange { background: #fdf0e0; color: #b8691a; }
.badge-blue { background: #e6effb; color: #2a6fbb; }
.badge-gray { background: #eef1f4; color: #5b6b7a; }
.badge-teal { background: #e2f4f1; color: #0d6b5f; }
.badge-purple { background: #efeaf9; color: #6f4fb0; }
.badge-gold { background: #fbf3dd; color: #8a6d15; }

/* ---------- 按钮 ---------- */
.btn-primary { background: var(--yj-primary); border-color: var(--yj-primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--yj-primary-dark); border-color: var(--yj-primary-dark); }
.btn-outline-primary { color: var(--yj-primary); border-color: #b9d9d3; }
.btn-outline-primary:hover { background: var(--yj-primary); border-color: var(--yj-primary); }
.btn { border-radius: 7px; font-size: 13px; }
.btn-sm { font-size: 12.5px; padding: .28rem .6rem; }

/* ---------- 表单 ---------- */
.form-label { font-size: 13px; color: #45596b; font-weight: 500; margin-bottom: 5px; }
.form-control, .form-select { font-size: 13.5px; border-color: #dbe3ea; border-radius: 7px; padding: .42rem .7rem; }
.form-control:focus, .form-select:focus { border-color: #7fc0b5; box-shadow: 0 0 0 3px rgba(13,107,95,.08); }
.form-text { font-size: 12px; }
.req-star { color: #e25555; margin-left: 2px; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 18px; border-bottom: 1px solid var(--yj-border); background: #fcfdfe; }
.filter-bar .form-control, .filter-bar .form-select { min-width: 140px; }

/* ---------- 详情 ---------- */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0; }
.detail-item { padding: 12px 18px; border-bottom: 1px solid #f1f4f7; }
.detail-item .k { color: var(--yj-muted); font-size: 12.5px; margin-bottom: 3px; }
.detail-item .v { font-size: 14px; font-weight: 500; word-break: break-all; }

.timeline { list-style: none; padding: 4px 0 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 18px 22px; border-left: 2px solid #e8eef3; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
    content: ''; position: absolute; left: -7px; top: 2px;
    width: 12px; height: 12px; border-radius: 50%;
    background: #17a08d; border: 2px solid #fff; box-shadow: 0 0 0 2px #d7ebe6;
}
.timeline .t { font-size: 12px; color: var(--yj-muted); }
.timeline .c { font-size: 13.5px; margin-top: 3px; }

/* ---------- 提示 ---------- */
.flash-wrap { position: fixed; top: 74px; right: 22px; z-index: 1090; width: 330px; }
.flash-wrap .alert { box-shadow: 0 8px 24px rgba(18,33,43,.12); border: none; font-size: 13px; }

/* ---------- 图表 ---------- */
.chart-box { position: relative; width: 100%; height: 280px; }

/* ---------- 打印 ---------- */
@media print {
    .yj-sidebar, .yj-topbar, .yj-footer, .no-print { display: none !important; }
    .yj-main { margin-left: 0; }
    .yj-content { padding: 0; }
    .yj-card { box-shadow: none; border: none; }
}

/* ---------- 移动端（手机/平板后台） ---------- */
@media (max-width: 991.98px) {
    .yj-sidebar { transform: translateX(-100%); width: min(86vw, 300px); padding-bottom: env(safe-area-inset-bottom); }
    .yj-sidebar.show { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.3); }
    .yj-nav .nav-item-link { padding: 11px 18px; font-size: 14px; }
    .yj-nav .group-title { padding: 12px 18px 6px; }
    .yj-main { margin-left: 0; }
    .yj-content { padding: 12px 12px 28px; }
    .yj-topbar { height: 54px; padding: 0 10px; }
    .yj-topbar .breadcrumb-mini { display: none; }
    .yj-topbar .page-title { font-size: 14px; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .yj-topbar .right { gap: 8px; }
    .user-chip .meta, .user-chip > i { display: none; }
    .topbar-icon { width: 32px; height: 32px; font-size: 16px; }
    .yj-footer { padding: 10px 12px; font-size: 11px; }
    .yj-footer span:last-child { display: none; }
    .yj-card { border-radius: 9px; margin-bottom: 12px; }
    .yj-card .card-head { padding: 12px 12px; }
    .yj-card .card-body-pad { padding: 12px; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat-card { padding: 12px; }
    .stat-card .value { font-size: 22px; }
    .stat-card .ico { width: 30px; height: 30px; font-size: 15px; right: 10px; top: 10px; }
    .filter-bar { padding: 12px; gap: 8px; }
    .filter-bar .form-control, .filter-bar .form-select { min-width: 0; width: 100%; }
    .filter-bar > * { flex: 1 1 100%; }
    .yj-table { font-size: 12.5px; }
    .yj-table thead th { padding: 8px 10px; font-size: 12px; }
    .yj-table tbody td { padding: 9px 10px; }
    .table-actions .btn { --bs-btn-font-size: .72rem; }
    /* 16px 可防止 iOS 聚焦输入框时自动放大整页 */
    .form-control, .form-select { font-size: 16px; }
    .form-label { font-size: 12.5px; }
    .detail-grid { grid-template-columns: 1fr; }
    .flash-wrap { top: 62px; right: 10px; left: 10px; width: auto; }
    .modal-dialog { margin: .6rem; }
    .btn { min-height: 36px; }
    .pagination { flex-wrap: wrap; }
    .page-link { padding: .32rem .6rem; font-size: 12.5px; }
}

/* 小屏手机 */
@media (max-width: 575.98px) {
    .yj-content { padding: 10px 8px 24px; }
    .stat-grid { gap: 8px; }
    .stat-card .value { font-size: 20px; }
    .stat-card .ico { display: none; }
    .yj-topbar .page-title { max-width: 40vw; }
    .d-none-xs { display: none !important; }
}
.yj-backdrop {
    position: fixed; inset: 0; background: rgba(10,18,25,.45);
    z-index: 1025; display: none;
}
.yj-backdrop.show { display: block; }
