:root {
    --bs-primary: #4f46e5;
    --bs-primary-rgb: 79, 70, 229;
    --wms-sidebar: #1e1b3a;
    --wms-sidebar-hover: #2c2760;
    --wms-bg: #f4f6fb;
}

body {
    background: var(--wms-bg);
    font-size: 14px;
    color: #1f2430;
}

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 248px;
    background: var(--wms-sidebar);
    color: #cfd2e8;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    overflow-y: auto;
}
.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 20px 22px; font-size: 20px; font-weight: 700; color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand i { color: #8b85ff; font-size: 24px; }
.sidebar-nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 4px; }
.sidebar-nav .nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 16px; border-radius: 10px;
    color: #cfd2e8; text-decoration: none; font-weight: 500;
    transition: background .15s, color .15s;
}
.sidebar-nav .nav-link i { font-size: 18px; }
.sidebar-nav .nav-link:hover { background: var(--wms-sidebar-hover); color: #fff; }
.sidebar-nav .nav-link.active { background: var(--bs-primary); color: #fff; box-shadow: 0 6px 16px rgba(79,70,229,.35); }

.main { flex: 1; margin-left: 248px; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    height: 60px; background: #fff; border-bottom: 1px solid #e7e9f2;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 22px; position: sticky; top: 0; z-index: 20;
}
.topbar .area-switch { display: flex; align-items: center; }
.content { padding: 24px 28px; flex: 1; }
.app-footer {
    padding: 14px 28px; border-top: 1px solid #e7e9f2; background: #fff;
    display: flex; gap: 12px; font-size: 12px; color: #6b7280;
}

/* ---------- 卡片 ---------- */
.card { border: none; border-radius: 14px; box-shadow: 0 1px 3px rgba(16,24,40,.06); }
.card-header { background: #fff; border-bottom: 1px solid #eef0f6; border-radius: 14px 14px 0 0 !important; font-weight: 600; }
.page-title { font-size: 20px; font-weight: 700; margin-bottom: 2px; }
.page-sub { color: #6b7280; font-size: 13px; margin-bottom: 18px; }

/* ---------- 统计卡 ---------- */
.stat-card {
    border-radius: 14px; padding: 18px 20px; color: #fff; height: 100%;
    position: relative; overflow: hidden;
}
.stat-card .stat-icon { position: absolute; right: 14px; top: 14px; font-size: 38px; opacity: .25; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; line-height: 1.1; }
.stat-card .stat-label { font-size: 13px; opacity: .92; }
.bg-grad-1 { background: linear-gradient(135deg,#4f46e5,#7c3aed); }
.bg-grad-2 { background: linear-gradient(135deg,#0ea5e9,#22d3ee); }
.bg-grad-3 { background: linear-gradient(135deg,#f59e0b,#f97316); }
.bg-grad-4 { background: linear-gradient(135deg,#ef4444,#ec4899); }

/* ---------- 表格 ---------- */
.table th { font-weight: 600; color: #374151; background: #fafbff; border-bottom-width: 1px; }
.table td { vertical-align: middle; }
.btn-action { padding: .2rem .5rem; font-size: 13px; }

/* ---------- 访客页 ---------- */
.guest-body {
    background: linear-gradient(135deg,#4f46e5 0%,#7c3aed 100%);
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
}
.guest-wrap { width: 100%; max-width: 420px; padding: 20px; }
.guest-brand { text-align: center; color: #fff; font-size: 22px; font-weight: 700; margin-bottom: 18px; }
.guest-brand i { color: #ffd; }
.guest-card { border-radius: 16px; }
.guest-foot { text-align: center; color: rgba(255,255,255,.8); margin-top: 14px; }

/* ---------- 徽标 ---------- */
.badge-soft { font-weight: 500; }
.expiry-soon { color: #d97706; font-weight: 600; }
.expiry-over { color: #dc2626; font-weight: 700; }

@media (max-width: 768px) {
    .sidebar { width: 64px; }
    .sidebar-brand span, .sidebar-nav .nav-link span { display: none; }
    .main { margin-left: 64px; }
    .content { padding: 16px; }
}
