/* ═══════════════════════════════════════════
   巡迹 · 管理后台 — Global Styles
   ═══════════════════════════════════════════ */

:root {
    font-size: 16px;          /* 锁定 rem 基准值，确保所有环境一致 */
    --sidebar-width: 220px;
    --topbar-height: 52px;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --border: #334155;
    --green: #22c55e;
    --amber: #f59e0b;
    --red: #ef4444;
    --blue: #3b82f6;
    --purple: #8b5cf6;
    --radius: 10px;
    --radius-sm: 6px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', -apple-system, sans-serif !important;
    font-size: 14px !important;  /* 覆盖 MudBlazor 的 .875rem，显式锁定 */
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ═══════════════════════════════════════════
   APP SHELL
   ═══════════════════════════════════════════ */

.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ═══════════════════════════════════════════
   SIDEBAR (NavMenu)
   ═══════════════════════════════════════════ */

.sidebar-left {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.logo-sm {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--accent), #818cf8);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.brand {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.nav-links {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
    cursor: pointer;
}

.nav-link:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-primary);
}

.nav-link.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent);
    font-weight: 600;
}

/* 子导航链接缩进 */
.nav-link.sub-link {
    padding-left: 38px;
    font-size: 13px;
}
.nav-link.sub-link .nav-icon {
    font-size: 14px;
    opacity: 0.7;
}

.nav-icon {
    font-size: 16px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

/* 消息未读数徽标 */
.nav-badge {
    margin-left: auto;
    min-width: 18px;
    height: 18px;
    background: #f43f5e;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 0 8px rgba(244, 63, 94, 0.5);
}

.nav-separator {
    height: 1px;
    background: rgba(148, 163, 184, 0.15);
    margin: 6px 14px;
}

.sidebar-footer {
    padding: 12px 10px;
    border-top: 1px solid var(--border);
}

.user-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 4px;
}

.user-mini img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
}

/* ═══════════════════════════════════════════
   MAIN AREA
   ═══════════════════════════════════════════ */

.main-area {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-bar {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    border-bottom: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-user-info {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-role-badge {
    font-size: 11px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.content-area {
    flex: 1;
    padding: 24px 28px;
}

/* ═══════════════════════════════════════════
   PAGE HEADER
   ═══════════════════════════════════════════ */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-header .sub {
    font-size: 13px;
    color: var(--text-muted);
}

.page-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text-secondary);
}
.btn-outline:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════
   NOTIFICATION LIST
   ═══════════════════════════════════════════ */

.notification-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 720px;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.12s;
}
.notification-item:hover {
    border-color: rgba(99,102,241,0.3);
    background: rgba(30,41,59,0.8);
}
.notification-item.unread {
    border-left: 3px solid var(--accent);
}

.notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(99,102,241,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.notif-body {
    flex: 1;
    min-width: 0;
}

.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.notif-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.notif-time {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    margin-left: 12px;
}

.notif-content {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    margin-top: 8px;
}

.notif-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    padding: 4px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 4px;
    transition: color .15s, background .15s;
    line-height: 1;
}
.notif-delete:hover {
    color: var(--red);
    background: rgba(239,68,68,0.1);
}
.notif-delete:disabled {
    cursor: default;
    opacity: .4;
}

/* pagination */
.pagination-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
}

/* ═══════════════════════════════════════════
   STAT CARDS
   ═══════════════════════════════════════════ */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border);
    transition: transform 0.15s, box-shadow 0.15s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.card-blue { border-left: 3px solid var(--blue); }
.card-green { border-left: 3px solid var(--green); }
.card-amber { border-left: 3px solid var(--amber); }
.card-purple { border-left: 3px solid var(--purple); }
.card-red { border-left: 3px solid var(--red); }

.stat-icon {
    font-size: 28px;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.08);
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════
   DASHBOARD GRID
   ═══════════════════════════════════════════ */

.dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 900px) {
    .dash-grid { grid-template-columns: 1fr; }
}

.card-dark {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border);
}

.card-dark h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* Progress circle */
.big-progress {
    display: flex;
    align-items: center;
    gap: 24px;
}

.circle-progress {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: conic-gradient(var(--accent) calc(var(--pct) * 3.6deg), #2e3a4e 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.circle-progress::before {
    content: '';
    position: absolute;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: var(--bg-card);
}

.circle-progress span {
    position: relative;
    z-index: 1;
    font-size: 18px;
    font-weight: 800;
    color: var(--accent);
}

.progress-detail {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-detail .item {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.dot.green { background: var(--green); }
.dot.amber { background: var(--amber); }
.dot.blue { background: var(--blue); }

/* Inspection feed */
.inspection-feed {
    display: flex;
    flex-direction: column;
}

.feed-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.feed-item:last-child { border-bottom: none; }

.feed-icon { font-size: 18px; flex-shrink: 0; padding-top: 2px; }

.feed-body { flex: 1; min-width: 0; }

.feed-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

.feed-status {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.feed-status.normal { background: rgba(34,197,94,0.12); color: var(--green); }
.feed-status.abnormal { background: rgba(239,68,68,0.12); color: var(--red); }

.feed-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.feed-time {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════ */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px 32px;
}

.login-top {
    text-align: center;
    margin-bottom: 28px;
}

.login-top .logo {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--accent), #818cf8);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    margin: 0 auto 16px;
}

.login-top h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.login-top p {
    font-size: 13px;
    color: var(--text-muted);
}

.login-error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(99,102,241,0.2);
}

.form-input::placeholder { color: #475569; }
.form-input:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-gradient {
    background: linear-gradient(135deg, var(--accent), #818cf8);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-gradient:hover { filter: brightness(1.1); }
.btn-gradient:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }

.btn-full { width: 100%; padding: 12px; font-size: 15px; }

.login-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════ */

.table-wrap {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.table-wrap table {
    width: 100%;
    border-collapse: collapse;
}

.table-wrap th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.4);
}

.table-wrap td {
    padding: 12px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.table-wrap tr:last-child td { border-bottom: none; }
.table-wrap tr:hover td { background: rgba(99,102,241,0.04); }

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.badge-green { background: rgba(34,197,94,0.12); color: var(--green); }
.badge-amber { background: rgba(245,158,11,0.12); color: var(--amber); }
.badge-red { background: rgba(239,68,68,0.12); color: var(--red); }
.badge-blue { background: rgba(59,130,246,0.12); color: var(--blue); }
.badge-gray { background: rgba(148,163,184,0.12); color: var(--text-secondary); }

/* ═══════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s;
}

.btn:hover { filter: brightness(1.1); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-danger { border-color: rgba(239,68,68,0.4); color: var(--red); }
.btn-danger:hover { background: rgba(239,68,68,0.15); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ═══════════════════════════════════════════
   TOOLBAR
   ═══════════════════════════════════════════ */

.toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    align-items: center;
    flex-wrap: wrap;
}

/* ═══════════════════════════════════════════
   MODAL / OVERLAY
   ═══════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 24px;
}

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
    width: 100%;
    max-width: 440px;
}

.modal-box h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 20px;
}

/* ═══════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════ */

.empty-state {
    text-align: center;
    padding: 60px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.mb-16 { margin-bottom: 16px; }
.mt-8 { margin-top: 8px; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ═══════════════════════════════════════════
   PROJECT CARDS GRID
   ═══════════════════════════════════════════ */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.project-card .top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.project-card .top h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.project-card .meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Action buttons on project card */
.card-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}
.project-card:hover .card-actions {
    opacity: 1;
}
.btn-edit-card,
.btn-delete-card {
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.btn-edit-card {
    background: rgba(59,130,246,0.12);
    color: #3b82f6;
}
.btn-edit-card:hover {
    background: rgba(59,130,246,0.3);
}
.btn-delete-card {
    background: rgba(239,68,68,0.12);
    color: #ef4444;
}
.btn-delete-card:hover {
    background: rgba(239,68,68,0.3);
}

.progress-bar {
    height: 6px;
    background: #2e3a4e;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-bar .fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}

.progress-bar .fill.green { background: var(--green); }
.progress-bar .fill.blue { background: var(--blue); }
.progress-bar .fill.amber { background: var(--amber); }

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════
   STATUS BADGE (component)
   ═══════════════════════════════════════════ */

.status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.status.normal { background: rgba(34,197,94,0.12); color: var(--green); }
.status.abnormal { background: rgba(239,68,68,0.12); color: var(--red); }
.status.pending { background: rgba(245,158,11,0.12); color: var(--amber); }
.status.warning { background: rgba(245,158,11,0.12); color: var(--amber); }
.status.done { background: rgba(148,163,184,0.12); color: var(--text-secondary); }
.status.info { background: rgba(59,130,246,0.12); color: var(--blue); }

/* ═══════════════════════════════════════════
   MODAL ACTIONS
   ═══════════════════════════════════════════ */

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.btn-sm-custom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
}
.btn-sm-custom.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.btn-sm-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
}

.btn-sm-ghost:hover { color: var(--text-primary); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* ═══════════════════════════════════════════
   STATS GRID (报表页面)
   ═══════════════════════════════════════════ */

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 900px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════
   CHART BARS (报表趋势图)
   ═══════════════════════════════════════════ */

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 0;
}

.chart-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.chart-bar {
    width: 100%;
    max-width: 40px;
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height 0.3s;
}

.chart-bar-col .lbl {
    font-size: 11px;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════
   BTN SM PRIMARY
   ═══════════════════════════════════════════ */

.btn-sm-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
}

.btn-sm-primary:hover { filter: brightness(1.1); }

/* ═══════════════════════════════════════════
   MODAL CONTENT (弹窗内容)
   ═══════════════════════════════════════════ */

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
    width: 100%;
    max-width: 440px;
}

.modal-content h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 16px;
}

/* ═══════════════════════════════════════════
   INPUT DARK (深色输入框)
   ═══════════════════════════════════════════ */

.input-dark {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
}

.input-dark:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(99,102,241,0.2);
}

.input-dark::placeholder { color: #475569; }

/* ═══════════════════════════════════════════
   PLANA CARD (设置-套餐信息)
   ═══════════════════════════════════════════ */

.plan-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}

.plan-card h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
}

.plan-card .usage {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.plan-card .usage .num {
    font-size: 20px;
    font-weight: 800;
    color: var(--accent);
}

.plan-card .usage .lbl {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 4px;
}

.plan-card .plan-desc {
    font-size: 13px;
    color: #6366f1;
    margin-top: 12px;
    line-height: 1.5;
}

.version-desc {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    padding: 12px 0 4px;
}

.usage-bar {
    height: 6px;
    background: #2e3a4e;
    border-radius: 3px;
    overflow: hidden;
}

.usage-bar .fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent), #818cf8);
    transition: width 0.3s;
}

/* ═══════════════════════════════════════════
   SETTINGS CARD (设置-企业信息/通知)
   ═══════════════════════════════════════════ */

.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}

.settings-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.setting-row:last-child { border-bottom: none; }

.setting-row .lbl {
    font-size: 13px;
    color: var(--text-secondary);
}

.setting-row .lbl small {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Toggle switch */
.toggle {
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: #334155;
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}

.toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #94a3b8;
    transition: all 0.2s;
}

.toggle.on {
    background: var(--accent);
}

.toggle.on::after {
    left: 23px;
    background: #fff;
}

/* ═══════════════════════════════════════════
   MODAL OVERLAY ACTIVE
   ═══════════════════════════════════════════ */

.modal-overlay.active {
    background: rgba(0,0,0,0.6);
}

/* ═══════════════════════════════════════════
   TABLE DARK (巡检点管理)
   ═══════════════════════════════════════════ */

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.table-dark {
    width: 100%;
    border-collapse: collapse;
}

.table-dark th {
    text-align: left;
    padding: 12px 20px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.4);
}

.table-dark td {
    padding: 14px 20px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.table-dark tr:last-child td { border-bottom: none; }
.table-dark tr:hover td { background: rgba(99,102,241,0.04); }

/* ═══════════════════════════════════════════
   INSPECTION DATA FLOW (v2.1)
   ═══════════════════════════════════════════ */

/* ── Toolbar ── */
.dataflow-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.df-select {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    font-size: 13px;
    min-width: 140px;
    cursor: pointer;
}

.df-select:focus { outline: none; border-color: var(--accent); }

.df-btn-group {
    display: flex;
    gap: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.df-btn-group .btn-sm-custom {
    border-radius: 0;
    border: none;
    border-right: 1px solid var(--border);
}

.df-btn-group .btn-sm-custom:last-child { border-right: none; }

.df-search {
    margin-left: auto;
}

.df-input {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    font-size: 13px;
    min-width: 180px;
}

.df-input:focus { outline: none; border-color: var(--accent); }
.df-input::placeholder { color: var(--text-muted); }

/* ── Timeline ── */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.tl-date-group { }

.tl-date-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.tl-date-badge {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--bg-card);
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.tl-date-count {
    font-size: 12px;
    color: var(--text-muted);
}

.tl-records {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tl-record {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.15s;
}

.tl-record:hover { border-color: #4b5563; }
.tl-record.expanded { border-color: var(--accent); }

.tl-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
}

.tl-time {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 44px;
    flex-shrink: 0;
}

.tl-icon {
    font-size: 16px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.tl-body {
    flex: 1;
    min-width: 0;
}

.tl-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.tl-point {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.tl-project {
    font-size: 12px;
    color: var(--text-muted);
    background: rgba(99,102,241,0.08);
    padding: 1px 8px;
    border-radius: 10px;
}

.tl-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.tl-remark {
    color: var(--text-secondary);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tl-tags {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.tl-expand-icon {
    font-size: 10px;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-left: 4px;
}

/* ── Status Badges ── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.normal {
    background: rgba(34, 197, 94, 0.12);
    color: var(--green);
}

.status-badge.abnormal {
    background: rgba(239, 68, 68, 0.12);
    color: var(--red);
}

.status-badge.ai {
    background: rgba(139, 92, 246, 0.10);
    color: var(--purple);
}

.status-badge.ai-ok {
    background: rgba(34, 197, 94, 0.08);
    color: var(--green);
}

.status-badge.ai-alert {
    background: rgba(239, 68, 68, 0.10);
    color: var(--red);
}

.status-badge.workorder {
    background: rgba(245, 158, 11, 0.10);
    color: var(--amber);
}

.status-badge.wo-pending { color: var(--amber); }
.status-badge.wo-proc { color: var(--blue); }
.status-badge.wo-done { color: var(--green); }
.status-badge.wo-closed { color: var(--text-muted); }

/* ── Detail Expand ── */
.tl-detail {
    border-top: 1px solid var(--border);
    padding: 16px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tl-detail-section { }

.tl-detail-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tl-ai-box {
    background: rgba(139, 92, 246, 0.04);
    border: 1px solid rgba(139, 92, 246, 0.12);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
}

.tl-ai-summary {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
}

.tl-ai-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.info-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    background: rgba(99,102,241,0.08);
    color: var(--text-secondary);
}

.info-chip.alert { background: rgba(239,68,68,0.08); color: var(--red); }
.info-chip.solution { background: rgba(34,197,94,0.08); color: var(--green); }

.tl-exc-box {
    background: rgba(245, 158, 11, 0.04);
    border: 1px solid rgba(245, 158, 11, 0.12);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-primary);
}

.tl-exc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.tl-photo {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

/* ── info-chip（信息芯片） ── */
.info-chip {
    display: inline-flex;
    align-items: center;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: var(--radius-sm);
    padding: 2px 8px;
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
}
.info-chip.alert {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
}
.info-chip.solution {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}
.chip-ok {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}
.chip-rej {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
}
.chip-warn {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}
.chip-proc {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}
.chip-done {
    background: rgba(107, 114, 128, 0.08);
    border-color: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

/* ── AI 复核操作区 ── */
.tl-ai-review-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.tl-review-hint {
    font-size: 12px;
    color: var(--text-secondary);
}
.btn-review {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}
.btn-review:hover {
    background: rgba(255,255,255,0.04);
}
.btn-review:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.btn-review-ok:hover {
    border-color: rgba(34, 197, 94, 0.4);
    color: #4ade80;
}
.btn-review-rej:hover {
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}
.btn-review-detail {
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--accent);
}
.btn-review-detail:hover {
    background: rgba(99, 102, 241, 0.06);
}
.tl-ai-reviewed {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ── 异常工单展开增强 ── */
.tl-exc-desc {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
}
.tl-exc-link {
    margin-top: 6px;
}
.btn-link-sm {
    font-size: 12px;
    color: var(--accent);
    text-decoration: none;
}
.btn-link-sm:hover {
    text-decoration: underline;
}

/* ── 基本信息四格 ── */
.tl-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 13px;
}
.tl-info-key {
    color: var(--text-muted);
    margin-right: 8px;
}
.tl-info-val {
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════
   底部汇总报告
   ═══════════════════════════════════════════ */

.report-section {
    margin-top: 40px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.report-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 15px;
    font-weight: 600;
}

.report-header-icon {
    font-size: 18px;
}

.report-period {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
}

.report-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.report-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
}

.report-card .rc-value {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.report-card .rc-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.rc-blue  { border-top: 3px solid var(--blue);  }
.rc-green { border-top: 3px solid var(--green); }
.rc-red   { border-top: 3px solid var(--red);   }
.rc-amber { border-top: 3px solid var(--amber); }
.rc-purple{ border-top: 3px solid var(--purple); }

.rc-blue  .rc-value  { color: #60a5fa; }
.rc-green .rc-value  { color: #4ade80; }
.rc-red   .rc-value  { color: #f87171; }
.rc-amber .rc-value  { color: #fbbf24; }
.rc-purple.rc-value  { color: #a78bfa; }

.report-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.report-col {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.report-col-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.trend-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trend-bar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.trend-bar-label {
    width: 32px;
    text-align: right;
    color: var(--text-muted);
    flex-shrink: 0;
}

.trend-bar-track {
    flex: 1;
    height: 16px;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    overflow: hidden;
}

.trend-bar-abnormal {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    border-radius: 8px;
    transition: width 0.3s ease;
}

.trend-bar-stats {
    width: 64px;
    text-align: right;
    color: var(--text-muted);
    flex-shrink: 0;
}

.tb-normal { color: var(--green); }
.tb-abnormal { color: var(--red); }

.ai-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.ai-stat-row:last-child {
    border-bottom: none;
}

.ai-stat-key {
    color: var(--text-secondary);
}

.ai-stat-val {
    color: var(--text-primary);
    font-weight: 500;
}

.report-empty {
    text-align: center;
    padding: 20px 0;
    color: var(--text-muted);
    font-size: 13px;
}

@media (max-width: 800px) {
    .report-cards { grid-template-columns: repeat(3, 1fr); }
    .report-grid-2col { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════
   二维码卡片弹窗
   ═══════════════════════════════════════════ */

.qrcard-modal {
    max-width: 560px;
    width: 90%;
    background: transparent;
    border-radius: 16px;
    position: relative;
}

.qrcard-container {
    display: flex;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 28px 24px;
    gap: 20px;
    min-height: 200px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}

.qrcard-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.qrcard-brand {
    font-size: 18px;
    font-weight: 600;
    color: #818cf8;
    margin-bottom: 8px;
}

.qrcard-project-name {
    font-size: 20px;
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1.3;
    margin-bottom: 12px;
    word-break: break-word;
}

.qrcard-divider {
    width: 36px;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #818cf8);
    border-radius: 2px;
    margin-bottom: 14px;
}

.qrcard-info {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 13px;
}

.qrcard-label {
    color: #64748b;
    white-space: nowrap;
    width: 44px;
    flex-shrink: 0;
}

.qrcard-value {
    color: #e2e8f0;
    word-break: break-all;
}

.qrcard-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 130px;
}

.qrcard-img {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    background: #fff;
    padding: 4px;
    object-fit: contain;
}

.qrcard-img-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    background: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 12px;
}

.qrcard-hint {
    font-size: 11px;
    color: #475569;
    margin-top: 8px;
    text-align: center;
}

.qrcard-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

/* card action buttons */
.btn-qr-card {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background 0.12s;
    opacity: 0.7;
    line-height: 1;
}
.btn-qr-card:hover {
    background: rgba(99, 102, 241, 0.12);
    opacity: 1;
}

/* 二维码卡片信息行 */
.qr-card-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}
.qr-card-info-row + .qr-card-info-row {
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* ═══════════════════════════════════════════
   Orders / SettingsOrders
   ═══════════════════════════════════════════ */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 720px;
}
.order-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
}
.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.order-no {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}
.order-status {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}
.status-pending {
    background: rgba(245,158,11,0.15);
    color: #f59e0b;
}
.status-paid {
    background: rgba(34,197,94,0.15);
    color: #22c55e;
}
.status-refunded {
    background: rgba(239,68,68,0.15);
    color: #ef4444;
}
.order-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 24px;
}
.order-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.order-info .label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.order-info .value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}
.order-info .value.price {
    color: #22c55e;
    font-weight: 700;
}
.order-footer {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
/* pagination */
.pagination-bar {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
}
.page-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.12s;
}
.page-btn:hover:not(:disabled):not(.active) {
    background: rgba(99,102,241,0.1);
    border-color: var(--accent);
    color: var(--text-primary);
}
.page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.page-btn:disabled {
    opacity: 0.4;
    cursor: default;
}
