/* =============================================================================
   宠物寄养基地管理系统 - 后台样式
   ========================================================================== */
:root {
    --jx-primary: #1677ff;
    --jx-sidebar-bg: #1f2a37;
    --jx-sidebar-hover: #2c3a4b;
    --jx-sidebar-active: #1677ff;
    --jx-border: #e5e7eb;
    --jx-text: #303133;
    --jx-muted: #8b95a5;
    --jx-bg: #f5f6f8;
    --jx-success: #18a058;
    --jx-warning: #f0a020;
    --jx-danger: #d03050;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--jx-bg);
    color: var(--jx-text);
    font-size: 14px;
}

/* ---------------------------------------------------------------- 布局 */
.jx-layout { display: flex; min-height: 100vh; }

.jx-sidebar {
    width: 230px;
    flex: 0 0 230px;
    background: var(--jx-sidebar-bg);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    overflow-y: auto;
    z-index: 1030;
}
.jx-brand {
    display: flex; align-items: center; gap: 8px;
    padding: 16px 18px;
    color: #fff; font-weight: 600; font-size: 15px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.jx-brand i { color: #4ea1ff; font-size: 18px; }
.jx-nav { flex: 1; padding: 8px 0; }
.jx-nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 18px;
    color: #cbd5e1; text-decoration: none;
    font-size: 14px; line-height: 1.4;
    transition: background .15s, color .15s;
}
.jx-nav-link:hover { background: var(--jx-sidebar-hover); color: #fff; }
.jx-nav-link.active { background: var(--jx-sidebar-active); color: #fff; }
.jx-nav-link .bi { width: 18px; text-align: center; }
.jx-caret { margin-left: auto; font-size: 11px; transition: transform .2s; }
.jx-nav-group.open .jx-caret { transform: rotate(180deg); }
.jx-subnav { display: none; background: rgba(0,0,0,.18); padding: 4px 0; }
.jx-nav-group.open .jx-subnav { display: block; }
.jx-subnav-link {
    display: block; padding: 8px 18px 8px 46px;
    color: #9fb0c4; text-decoration: none; font-size: 13px;
}
.jx-subnav-link:hover { color: #fff; background: var(--jx-sidebar-hover); }
.jx-subnav-link.active { color: #fff; font-weight: 500; }
.jx-sidebar-footer { padding: 12px 18px; font-size: 12px; color: #64748b; }

.jx-main { flex: 1; margin-left: 230px; display: flex; flex-direction: column; min-width: 0; }
.jx-topbar {
    display: flex; align-items: center; gap: 12px;
    background: #fff; padding: 12px 20px;
    border-bottom: 1px solid var(--jx-border);
    position: sticky; top: 0; z-index: 1020;
}
.jx-page-title { font-size: 17px; font-weight: 600; margin: 0; flex: 1; }
.jx-topbar-right { display: flex; align-items: center; gap: 8px; }
.jx-content { padding: 18px 20px; flex: 1; }
.jx-footer { text-align: center; color: var(--jx-muted); font-size: 12px; padding: 14px; }

@media (max-width: 991.98px) {
    .jx-sidebar { transform: translateX(-100%); transition: transform .25s; }
    .jx-sidebar.show { transform: translateX(0); }
    .jx-main { margin-left: 0; }
}

/* ---------------------------------------------------------------- 卡片 */
.jx-card {
    background: #fff; border-radius: 10px;
    border: 1px solid var(--jx-border);
    margin-bottom: 16px;
}
.jx-card-header {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 16px; border-bottom: 1px solid var(--jx-border);
    font-weight: 600;
}
.jx-card-header .jx-card-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.jx-card-body { padding: 16px; }
.jx-card-body.p-0 { padding: 0; }

/* 统计卡片 */
.jx-stat {
    background: #fff; border: 1px solid var(--jx-border); border-radius: 10px;
    padding: 14px 16px; height: 100%;
    display: flex; align-items: center; gap: 12px;
}
.jx-stat-icon {
    width: 42px; height: 42px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex: 0 0 42px;
}
.jx-stat-label { color: var(--jx-muted); font-size: 12px; margin-bottom: 2px; }
.jx-stat-value { font-size: 22px; font-weight: 600; line-height: 1.2; }
.jx-stat-value small { font-size: 12px; color: var(--jx-muted); font-weight: 400; }
.jx-stat-primary { background: #e8f1ff; color: var(--jx-primary); }
.jx-stat-success { background: #e6f7ee; color: var(--jx-success); }
.jx-stat-warning { background: #fff5e6; color: var(--jx-warning); }
.jx-stat-danger  { background: #ffecef; color: var(--jx-danger); }
.jx-stat-info    { background: #eaf4ff; color: #0d84c9; }

/* ---------------------------------------------------------------- 表格 */
.jx-table { width: 100%; border-collapse: collapse; }
.jx-table thead th {
    background: #fafbfc; color: #5a6474; font-weight: 600; font-size: 13px;
    padding: 10px 12px; border-bottom: 1px solid var(--jx-border); white-space: nowrap;
}
.jx-table tbody td { padding: 10px 12px; border-bottom: 1px solid #f0f2f5; vertical-align: middle; }
.jx-table tbody tr:hover { background: #fafcff; }
.jx-table tbody tr.jx-row-warning { background: #fffaf0; }
.jx-table tbody tr.jx-row-danger { background: #fff5f6; }
.jx-table-actions { white-space: nowrap; }
.jx-table-actions .btn { padding: 2px 8px; font-size: 12px; }
.jx-empty { text-align: center; color: var(--jx-muted); padding: 36px 0; }
.jx-empty i { font-size: 34px; display: block; margin-bottom: 8px; color: #cbd5e1; }
.jx-table-wrap { overflow-x: auto; }

/* ---------------------------------------------------------------- 表单 */
.jx-form-label { font-weight: 500; margin-bottom: 4px; font-size: 13px; }
.jx-form-label .required { color: var(--jx-danger); margin-left: 2px; }
.jx-form-hint { color: var(--jx-muted); font-size: 12px; margin-top: 4px; }
.jx-filter-bar {
    background: #fff; border: 1px solid var(--jx-border); border-radius: 10px;
    padding: 12px 14px; margin-bottom: 14px;
}
.jx-filter-bar form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.jx-filter-bar .form-control, .jx-filter-bar .form-select { max-width: 200px; }

/* ---------------------------------------------------------------- 分页 */
.jx-pagination {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; flex-wrap: wrap; gap: 8px;
}
.jx-pagination-total { color: var(--jx-muted); font-size: 12px; }

/* ---------------------------------------------------------------- 其他 */
.jx-badge-soft {
    display: inline-block; padding: 2px 8px; border-radius: 20px;
    font-size: 12px; line-height: 1.6;
}
.jx-detail-list { margin: 0; }
.jx-detail-list dt { color: var(--jx-muted); font-weight: 400; font-size: 12px; margin-top: 10px; }
.jx-detail-list dd { margin: 2px 0 0; font-weight: 500; word-break: break-all; }
.jx-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.jx-pet-thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: #f0f2f5; }
.jx-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.jx-media-item { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--jx-border); background: #000; }
.jx-media-item img, .jx-media-item video { width: 100%; height: 110px; object-fit: cover; display: block; }
.jx-timeline { list-style: none; padding-left: 0; margin: 0; }
.jx-timeline li { position: relative; padding: 0 0 14px 18px; border-left: 2px solid #eef1f5; }
.jx-timeline li:last-child { border-left-color: transparent; }
.jx-timeline li::before {
    content: ''; position: absolute; left: -6px; top: 4px;
    width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1;
}
.jx-timeline li.active::before { background: var(--jx-primary); }
.jx-timeline-time { color: var(--jx-muted); font-size: 12px; }
.jx-progress { height: 6px; border-radius: 6px; background: #eef1f5; overflow: hidden; }
.jx-progress > span { display: block; height: 100%; background: var(--jx-primary); }
.jx-help { background: #f8fafc; border-left: 3px solid var(--jx-primary); padding: 10px 14px; border-radius: 4px; font-size: 13px; color: #56606e; }
.jx-print-link { color: var(--jx-primary); text-decoration: none; }
.jx-token-box { font-family: Menlo, Monaco, monospace; font-size: 12px; background: #f6f8fa; padding: 4px 8px; border-radius: 4px; word-break: break-all; }
.text-muted-sm { color: var(--jx-muted); font-size: 12px; }
.jx-required-hint { color: var(--jx-danger); }

/* 登录页 */
.jx-auth-body {
    min-height: 100vh; margin: 0;
    background: linear-gradient(135deg, #1677ff 0%, #0b4bb8 55%, #12305e 100%);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.jx-auth-wrap { width: 100%; max-width: 420px; }
.jx-auth-card { background: #fff; border-radius: 14px; padding: 34px 30px; box-shadow: 0 18px 50px rgba(0,0,0,.22); }
.jx-auth-title { font-size: 20px; font-weight: 600; text-align: center; margin-bottom: 4px; }
.jx-auth-sub { text-align: center; color: var(--jx-muted); font-size: 13px; margin-bottom: 22px; }
.jx-auth-logo { text-align: center; font-size: 40px; color: var(--jx-primary); margin-bottom: 6px; }
.jx-auth-footer { text-align: center; color: rgba(255,255,255,.75); font-size: 12px; margin-top: 16px; }
