:root {
            --bg-main: #050b11;
            --bg-deep: #08141f;
            --panel: rgba(9, 27, 40, 0.86);
            --line-cyan: #23e5ff;
            --line-cyan-soft: rgba(35, 229, 255, 0.35);
            --text-main: #daf9ff;
            --text-muted: #7ca7b4;
            --scroll-track: rgba(8, 20, 31, 0.6);
            --scroll-thumb: rgba(35, 229, 255, 0.4);
            --scroll-thumb-hover: rgba(35, 229, 255, 0.6);
            --ok: #42f8d0;
            --warn: #ffbf4a;
            --danger: #ff8f54;
            --info: #5eb6ff;
            --border: rgba(63, 175, 206, 0.38);
            --shadow: 0 18px 38px rgba(0, 0, 0, 0.42);
            --radius: 14px;
            --sidebar-w: 220px;
            --font-code: "SFMono-Regular", "SF Mono", "Roboto Mono", "Menlo", "Consolas", "Liberation Mono", monospace;
        }

        ::-webkit-scrollbar { width: 8px; height: 8px; }
        ::-webkit-scrollbar-track { background: var(--scroll-track); }
        ::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 4px; }
        ::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }

        * { box-sizing: border-box; }
        html, body { margin: 0; padding: 0; min-height: 100%; }

        body {
            font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
            color: var(--text-main);
            background:
                radial-gradient(circle at 14% 10%, rgba(35, 229, 255, 0.16), transparent 38%),
                radial-gradient(circle at 86% 8%, rgba(255, 191, 74, 0.12), transparent 34%),
                linear-gradient(180deg, #06131d 0%, #04080e 100%);
            letter-spacing: 0.2px;
            position: relative;
            overflow-x: hidden;
        }

        body::before {
            content: '';
            position: fixed;
            inset: 0;
            pointer-events: none;
            background-image:
                repeating-linear-gradient(to right, rgba(35, 229, 255, 0.06) 0px, rgba(35, 229, 255, 0.06) 1px, transparent 1px, transparent 72px),
                repeating-linear-gradient(to bottom, rgba(35, 229, 255, 0.045) 0px, rgba(35, 229, 255, 0.045) 1px, transparent 1px, transparent 72px);
            opacity: 0.2;
            z-index: -2;
        }

        body::after {
            content: '';
            position: fixed;
            width: 620px;
            height: 620px;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(35, 229, 255, 0.12) 0%, transparent 70%);
            filter: blur(26px);
            left: -180px;
            bottom: -240px;
            pointer-events: none;
            z-index: -1;
        }

        /* ===== Login Overlay ===== */
        #loginOverlay {
            position: fixed;
            inset: 0;
            background: linear-gradient(135deg, #050b14 0%, #0a1c2a 50%, #081420 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 999;
        }

        #loginBox {
            width: min(360px, calc(100vw - 26px));
            background: linear-gradient(170deg, rgba(8, 27, 40, 0.96), rgba(8, 20, 31, 0.95));
            border: 1px solid rgba(35, 229, 255, 0.35);
            border-radius: var(--radius);
            padding: 24px 20px 40px;
            box-shadow: var(--shadow);
            position: relative;
            overflow: hidden;
        }

        #loginBox h2 {
            margin: 0 0 14px;
            text-align: center;
            color: #d4f9ff;
            font-size: 20px;
            letter-spacing: 1px;
        }

        .login-footer {
            position: absolute;
            bottom: 12px;
            left: 0;
            right: 0;
            text-align: center;
            color: #7ca7b4;
            font-size: 12px;
        }

        #loginError {
            color: #ffd08f;
            font-size: 12px;
            margin-top: 9px;
            display: none;
            text-align: center;
            background: rgba(99, 57, 4, 0.35);
            border: 1px solid rgba(255, 191, 74, 0.45);
            border-radius: 7px;
            padding: 6px 8px;
        }

        /* ===== Layout ===== */
        .app-layout {
            display: flex;
            min-height: 100vh;
        }

        .sidebar {
            width: var(--sidebar-w);
            background: linear-gradient(180deg, rgba(8, 24, 36, 0.98), rgba(6, 16, 26, 0.98));
            border-right: 1px solid var(--border);
            padding: 16px 0 0;
            position: fixed;
            top: 0;
            left: 0;
            bottom: 0;
            overflow-y: auto;
            z-index: 100;
            display: flex;
            flex-direction: column;
        }

        .sidebar-logo {
            padding: 8px 16px 16px;
            border-bottom: 1px solid var(--border);
            margin-bottom: 8px;
        }

        .sidebar-logo h2 {
            margin: 0;
            font-size: 18px;
            color: #d6fbff;
            text-align: center;
            letter-spacing: 1px;
        }

        .sidebar-logo .version {
            text-align: center;
            font-size: 12px;
            color: var(--text-muted);
            margin-top: 4px;
        }

        .sidebar-footer {
            padding: 20px 12px;
            border-top: 1px solid rgba(35, 229, 255, 0.15);
            margin-top: auto;
        }

        .sidebar-footer .copyright {
            font-size: 13px;
            color: var(--text-muted);
            text-align: center;
            opacity: 0.7;
            letter-spacing: 0.5px;
        }

        .nav-section {
            padding: 8px 0;
        }

        .nav-section-title {
            padding: 6px 16px;
            font-size: 12px;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .nav-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 12px 16px;
            color: var(--text-main);
            cursor: pointer;
            transition: all 0.2s;
            border-left: 3px solid transparent;
            font-size: 15px;
        }

        .nav-item:hover {
            background: rgba(35, 229, 255, 0.08);
        }

        .nav-item.active {
            background: rgba(35, 229, 255, 0.12);
            border-left-color: var(--line-cyan);
            color: var(--line-cyan);
        }

        .nav-item .icon {
            width: 18px;
            text-align: center;
            font-size: 14px;
        }

        .nav-item .badge {
            margin-left: auto;
            background: var(--danger);
            color: #fff;
            font-size: 10px;
            padding: 2px 6px;
            border-radius: 10px;
            font-weight: 700;
        }

        .main-content {
            flex: 1;
            margin-left: var(--sidebar-w);
            padding: 20px 24px;
            min-height: 100vh;
        }

        .topbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 16px;
            border-bottom: 1px solid var(--border);
        }

        .topbar h1 {
            margin: 0;
            font-size: 20px;
            font-weight: 700;
            color: #d6fbff;
            letter-spacing: 1px;
        }

        .topbar-actions {
            display: flex;
            align-items: center;
            gap: 12px;
        }

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

        .user-tag strong {
            color: var(--text-main);
            font-weight: 700;
        }

        /* ===== Panels ===== */
        .panel {
            background: linear-gradient(145deg, rgba(9, 31, 46, 0.96), rgba(7, 21, 33, 0.92));
            border: 1px solid var(--border);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            position: relative;
            overflow: hidden;
            margin-bottom: 16px;
        }


        .panel-header {
            padding: 14px 18px;
            border-bottom: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .panel-header h2 {
            margin: 0;
            font-size: 15px;
            color: #cbf6ff;
            font-weight: 600;
        }

        .panel-body {
            padding: 16px 18px;
        }

        .box-code {
            font-family: var(--font-code);
            letter-spacing: 0.4px;
            font-variant-numeric: tabular-nums;
            font-feature-settings: "liga" 0, "calt" 0;
        }

        .box-code-strong {
            font-family: var(--font-code);
            letter-spacing: 0.5px;
            font-variant-numeric: tabular-nums;
            font-feature-settings: "liga" 0, "calt" 0;
            font-weight: 700;
        }

        .box-code-input {
            font-family: var(--font-code);
            letter-spacing: 0.5px;
            font-variant-numeric: tabular-nums;
            font-feature-settings: "liga" 0, "calt" 0;
            text-transform: uppercase;
        }

        /* ===== Stats Grid ===== */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
            gap: 12px;
            margin-bottom: 16px;
        }

        .stats-grid.stats-compact {
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            margin-bottom: 12px;
            gap: 10px;
        }

        .stats-grid.stats-compact .stat-cell {
            padding: 10px 14px;
        }

        .stats-grid.stats-compact .stat-cell .value {
            font-size: 18px;
        }

        /* ===== Global Search ===== */
        .global-search-panel {
            overflow: visible;
        }

        .global-search-toolbar,
        .global-search-page-toolbar {
            display: flex;
            gap: 12px;
            align-items: flex-start;
        }

        .global-search-input-wrap {
            min-width: 0;
        }

        .global-search-toolbar .global-search-input-wrap {
            flex: 0 0 calc(50% - 18px);
        }

        .global-search-page-toolbar .global-search-input-wrap {
            flex: 1;
        }

        .global-search-action-wrap {
            flex: 0 0 120px;
            display: flex;
            justify-content: center;
        }

        .global-search-history-wrap {
            flex: 1;
            min-width: 0;
            display: flex;
            align-items: center;
            gap: 10px;
            overflow: hidden;
        }

        .global-search-history-title {
            flex: 0 0 auto;
            font-size: 12px;
            color: var(--text-muted);
            line-height: 1.2;
            white-space: nowrap;
        }

        .global-search-history-list {
            display: flex;
            flex: 1;
            min-width: 0;
            flex-wrap: nowrap;
            gap: 8px;
            min-height: 37px;
            align-items: center;
            overflow-x: auto;
            overflow-y: hidden;
            white-space: nowrap;
            padding-bottom: 2px;
            scrollbar-width: none;
        }

        .global-search-history-list::-webkit-scrollbar {
            display: none;
        }

        .global-search-history-empty {
            flex: 0 0 auto;
            font-size: 12px;
            color: rgba(124, 167, 180, 0.78);
            line-height: 37px;
            white-space: nowrap;
        }

        .global-search-history-chip {
            position: relative;
            flex: 0 0 auto;
            display: inline-flex;
            align-items: center;
            max-width: 180px;
            overflow: visible;
            border: 1px solid rgba(35, 229, 255, 0.22);
            background: rgba(255, 255, 255, 0.03);
            color: #d7f8ff;
            border-radius: 999px;
            padding: 7px 12px;
            font-size: 12px;
            line-height: 1;
            cursor: pointer;
            user-select: none;
            transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
        }

        .global-search-history-chip:hover {
            background: rgba(35, 229, 255, 0.08);
            border-color: rgba(35, 229, 255, 0.36);
            transform: translateY(-1px);
        }

        .global-search-history-chip.is-armed {
            border-color: rgba(255, 143, 84, 0.48);
            background: rgba(255, 143, 84, 0.1);
        }

        .global-search-history-label {
            display: inline-block;
            max-width: 180px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .global-search-history-delete {
            position: absolute;
            right: -5px;
            top: -5px;
            width: 18px;
            height: 18px;
            border: 0;
            border-radius: 50%;
            display: none;
            align-items: center;
            justify-content: center;
            background: rgba(255, 143, 84, 0.16);
            color: #ffd8c6;
            cursor: pointer;
            font-size: 11px;
            line-height: 1;
        }

        .global-search-history-chip.is-armed .global-search-history-delete {
            display: inline-flex;
        }

        .global-search-hint {
            margin-top: 6px;
            font-size: 12px;
            color: var(--text-muted);
        }

        .global-search-toolbar > .btn,
        .global-search-page-toolbar > .btn {
            height: 37px;
            min-height: 37px;
            padding-top: 0;
            padding-bottom: 0;
            align-self: flex-start;
        }

        .global-search-action-wrap > .btn {
            width: 100%;
            height: 37px;
            min-height: 37px;
            padding-top: 0;
            padding-bottom: 0;
        }

        .global-search-preview {
            display: none;
            margin-top: 14px;
            border: 1px solid rgba(35, 229, 255, 0.18);
            border-radius: 12px;
            background: linear-gradient(180deg, rgba(6, 24, 37, 0.98), rgba(4, 16, 25, 0.98));
            overflow: hidden;
        }

        .global-search-preview.show {
            display: block;
        }

        .global-search-preview-list {
            display: grid;
        }

        .global-search-preview-item {
            width: 100%;
            border: 0;
            border-bottom: 1px solid rgba(255,255,255,0.06);
            background: transparent;
            color: inherit;
            text-align: left;
            padding: 12px 14px;
            display: flex;
            align-items: center;
            gap: 10px;
            cursor: pointer;
        }

        .global-search-preview-item:hover {
            background: rgba(35, 229, 255, 0.06);
        }

        .global-search-preview-main {
            display: flex;
            flex-direction: column;
            gap: 4px;
            min-width: 0;
        }

        .global-search-preview-main strong,
        .global-search-result-title {
            color: #defcff;
            font-size: 14px;
        }

        .global-search-preview-main span,
        .global-search-result-subtitle,
        .global-search-summary-sub {
            color: var(--text-muted);
            font-size: 12px;
        }

        .global-search-preview-foot {
            padding: 12px 14px;
            display: flex;
            justify-content: flex-end;
            background: rgba(255,255,255,0.02);
        }

        .global-search-type-tabs {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            margin: 14px 0 12px;
        }

        .global-search-type-tabs .btn.active {
            border-color: var(--line-cyan);
            color: var(--line-cyan);
            box-shadow: 0 0 14px rgba(35, 229, 255, 0.22);
        }

        .global-search-summary {
            margin-bottom: 14px;
            padding: 12px 14px;
            border: 1px solid rgba(35, 229, 255, 0.14);
            border-radius: 10px;
            background: rgba(5, 18, 29, 0.46);
        }

        .global-search-summary-main {
            font-size: 14px;
            color: var(--text-main);
        }

        .global-search-results {
            display: grid;
            gap: 16px;
        }

        .global-search-group {
            display: grid;
            gap: 10px;
        }

        .global-search-group-title {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 14px;
            font-weight: 700;
            color: #d5fbff;
        }

        .global-search-group-title span {
            color: var(--text-muted);
            font-size: 12px;
            font-weight: 500;
        }

        .global-search-group-list {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
            gap: 12px;
        }

        .global-search-result-card {
            border: 1px solid rgba(35, 229, 255, 0.18);
            border-radius: 12px;
            background: linear-gradient(180deg, rgba(7, 25, 38, 0.86), rgba(5, 18, 28, 0.94));
            padding: 14px;
            display: grid;
            gap: 10px;
        }

        .global-search-result-head {
            display: flex;
            gap: 8px;
            align-items: center;
            flex-wrap: wrap;
        }

        .global-search-result-actions {
            display: flex;
            justify-content: flex-end;
        }

        .global-search-empty {
            padding: 22px 16px;
            text-align: center;
            color: var(--text-muted);
            border: 1px dashed rgba(124, 167, 180, 0.22);
            border-radius: 10px;
            background: rgba(255,255,255,0.02);
        }

        .print-center-toolbar {
            display: grid;
            grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(140px, 1fr));
            gap: 12px;
            align-items: end;
        }

        .print-center-toolbar .form-group {
            margin-bottom: 0;
        }

        .print-center-toolbar-actions-row {
            display: flex;
            margin-top: 12px;
            justify-content: flex-start;
        }

        .print-center-toolbar-actions-row .btn {
            min-width: 140px;
        }

        .print-center-summary {
            margin-top: 14px;
            padding: 12px 14px;
            border: 1px solid rgba(35, 229, 255, 0.14);
            border-radius: 10px;
            background: rgba(5, 18, 29, 0.46);
        }

        .print-ticket-preview-wrap {
            display: flex;
            justify-content: center;
            padding: 4px 0;
        }

        .print-ticket {
            width: min(100%, 360px);
            background: linear-gradient(180deg, rgba(5, 18, 29, 0.96), rgba(3, 12, 20, 0.98));
            border: 1px dashed rgba(35, 229, 255, 0.4);
            border-radius: 14px;
            padding: 18px 16px;
            box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
        }

        .print-ticket-brand {
            text-align: center;
            font-size: 20px;
            font-weight: 700;
            color: #defcff;
            letter-spacing: 1px;
            margin-bottom: 4px;
        }

        .print-ticket-title {
            text-align: center;
            font-size: 26px;
            font-weight: 800;
            color: var(--warn);
            letter-spacing: 2px;
            margin-bottom: 16px;
        }

        .print-ticket-grid {
            display: grid;
            gap: 8px;
        }

        .print-ticket-row {
            display: grid;
            grid-template-columns: 72px 1fr;
            gap: 8px;
            align-items: start;
            font-size: 13px;
        }

        .print-ticket-row span {
            color: var(--text-muted);
        }

        .print-ticket-row strong {
            color: var(--text-main);
            word-break: break-all;
        }

        .print-ticket-mixed {
            font-family: "SF Pro Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
            letter-spacing: 0.2px;
            font-variant-numeric: tabular-nums;
        }

        .print-ticket-row-full {
            grid-template-columns: 72px 1fr;
        }

        .stat-cell {
            border: 1px solid rgba(35, 229, 255, 0.22);
            border-radius: 10px;
            background: linear-gradient(180deg, rgba(9, 36, 50, 0.62), rgba(6, 23, 35, 0.86));
            padding: 14px;
        }

        .stat-cell.warn {
            border-color: rgba(255, 191, 74, 0.4);
            background: linear-gradient(180deg, rgba(55, 38, 8, 0.54), rgba(38, 24, 5, 0.72));
        }

        .stat-cell.danger {
            border-color: rgba(255, 143, 84, 0.4);
            background: linear-gradient(180deg, rgba(55, 24, 8, 0.54), rgba(38, 12, 5, 0.72));
        }

        .stat-cell.ok {
            border-color: rgba(66, 248, 208, 0.4);
            background: linear-gradient(180deg, rgba(9, 50, 40, 0.54), rgba(6, 35, 28, 0.72));
        }

        .stat-cell.info {
            border-color: rgba(94, 182, 255, 0.4);
            background: linear-gradient(180deg, rgba(9, 30, 50, 0.54), rgba(6, 20, 35, 0.72));
        }

        .stat-cell .label {
            color: var(--text-muted);
            font-size: 12px;
            letter-spacing: 0.5px;
            margin-bottom: 4px;
        }

        .stat-cell .value {
            color: #defcff;
            font-family: "SF Mono", "Menlo", "Consolas", monospace;
            font-size: 22px;
            font-weight: 700;
        }

        /* ===== Forms ===== */
        .form-group {
            margin-bottom: 12px;
        }

        .form-row {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 12px;
        }

        label {
            display: block;
            margin-bottom: 6px;
            font-size: 12px;
            color: var(--text-muted);
            letter-spacing: 0.4px;
        }

        .required-mark {
            color: #ff9f6b;
            font-weight: 700;
            margin-left: 2px;
        }

        input, select, textarea {
            width: 100%;
            box-sizing: border-box;
            padding: 9px 12px;
            border: 1px solid rgba(63, 175, 206, 0.5);
            border-radius: 8px;
            color: var(--text-main);
            background: linear-gradient(180deg, rgba(7, 27, 40, 0.95), rgba(5, 20, 30, 0.95));
            outline: none;
            transition: border-color .2s, box-shadow .2s;
            font-size: 13px;
        }

        select {
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            padding-right: 36px;
            background-image:
                linear-gradient(180deg, rgba(7, 27, 40, 0.95), rgba(5, 20, 30, 0.95)),
                url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M3.2 5.1L7 8.9l3.8-3.8' fill='none' stroke='%23e7fbff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
            background-repeat: no-repeat, no-repeat;
            background-position: center, right 12px center;
            background-size: auto, 14px 14px;
        }

        select::-ms-expand {
            display: none;
        }

        input:focus, select:focus, textarea:focus {
            border-color: var(--line-cyan);
            box-shadow: 0 0 0 2px rgba(35, 229, 255, 0.18);
        }

        input[type="date"] {
            color-scheme: dark;
            height: 34px;
        }

        input[type="date"]::-webkit-calendar-picker-indicator {
            cursor: pointer;
            opacity: 1;
            filter: none;
            background-color: var(--line-cyan);
            -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2323e5ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E") center/contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2323e5ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E") center/contain no-repeat;
        }

        input[type="date"]::-webkit-calendar-picker-indicator:hover {
            opacity: 1;
            background-color: var(--line-cyan);
            filter: brightness(1.2);
        }

        /* ===== Buttons ===== */
        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 9px 16px;
            border-radius: 8px;
            border: 1px solid rgba(35, 229, 255, 0.5);
            background: linear-gradient(120deg, rgba(9, 45, 59, 0.96), rgba(14, 116, 131, 0.86));
            color: #d9fcff;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn:hover {
            border-color: var(--line-cyan);
            box-shadow: 0 0 14px rgba(35, 229, 255, 0.3);
        }

        .btn-warn {
            border-color: rgba(255, 191, 74, 0.55);
            background: linear-gradient(120deg, rgba(79, 52, 8, 0.95), rgba(189, 118, 22, 0.88));
            color: #fff3dd;
        }

        .btn-warn:hover {
            border-color: var(--warn);
            box-shadow: 0 0 14px rgba(255, 191, 74, 0.3);
        }

        .btn-danger {
            border-color: rgba(255, 143, 84, 0.55);
            background: linear-gradient(120deg, rgba(79, 30, 8, 0.95), rgba(189, 80, 22, 0.88));
            color: #ffeedd;
        }

        .btn-danger:hover {
            border-color: var(--danger);
            box-shadow: 0 0 14px rgba(255, 143, 84, 0.3);
        }

        .btn-ghost {
            border-color: rgba(132, 170, 183, 0.45);
            background: linear-gradient(120deg, rgba(27, 43, 55, 0.9), rgba(35, 61, 74, 0.85));
            color: #cde4ea;
        }

        .btn-sm {
            padding: 5px 10px;
            font-size: 12px;
        }

        .btn-group {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }

        /* ===== Tables ===== */
        .table-wrap {
            border: 1px solid rgba(35, 229, 255, 0.2);
            border-radius: 10px;
            overflow: auto;
            background: rgba(5, 18, 29, 0.72);
        }

        table {
            width: 100%;
            border-collapse: collapse;
            min-width: 760px;
            font-size: 13px;
        }

        th, td {
            border-bottom: 1px solid rgba(83, 146, 167, 0.2);
            padding: 10px 12px;
            text-align: center;
            vertical-align: middle;
        }

        th {
            position: sticky;
            top: 0;
            z-index: 2;
            background: linear-gradient(180deg, rgba(6, 28, 40, 0.96), rgba(7, 22, 32, 0.96));
            color: #9ed6e4;
            font-size: 12px;
            font-weight: 600;
        }

        tr:hover td {
            background: rgba(35, 229, 255, 0.05);
        }

        .user-name-cell {
            font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
            font-weight: 500;
            color: var(--text-main);
            letter-spacing: 0;
        }

        .role-permission-preview {
            min-height: 42px;
            padding: 10px 12px;
            border: 1px solid rgba(35, 229, 255, 0.18);
            border-radius: 8px;
            background: rgba(0, 0, 0, 0.18);
            color: var(--text-muted);
            font-size: 12px;
            line-height: 1.6;
        }

        /* ===== Tags ===== */
        .tag {
            display: inline-block;
            padding: 2px 8px;
            border-radius: 999px;
            font-size: 11px;
            font-weight: 600;
        }

        .tag-ok { background: rgba(66, 248, 208, 0.15); color: var(--ok); border: 1px solid rgba(66, 248, 208, 0.4); }
        .tag-warn { background: rgba(255, 191, 74, 0.15); color: var(--warn); border: 1px solid rgba(255, 191, 74, 0.4); }
        .tag-danger { background: rgba(255, 143, 84, 0.15); color: var(--danger); border: 1px solid rgba(255, 143, 84, 0.4); }
        .tag-info { background: rgba(94, 182, 255, 0.15); color: var(--info); border: 1px solid rgba(94, 182, 255, 0.4); }
        .tag-muted { background: rgba(124, 167, 180, 0.15); color: var(--text-muted); border: 1px solid rgba(124, 167, 180, 0.4); }

        /* ===== Toolbar ===== */
        .toolbar {
            display: flex;
            gap: 10px;
            align-items: flex-end;
            flex-wrap: wrap;
            margin-bottom: 14px;
            padding: 12px;
            background: rgba(5, 18, 29, 0.5);
            border-radius: 10px;
            border: 1px solid rgba(35, 229, 255, 0.15);
        }

        .toolbar .form-group {
            margin-bottom: 0;
            min-width: 140px;
        }

        @media (max-width: 768px) {
            .global-search-toolbar,
            .global-search-page-toolbar {
                flex-direction: column;
            }

            .global-search-input-wrap,
            .global-search-action-wrap,
            .global-search-history-wrap {
                flex: 1 1 auto;
                width: 100%;
            }

            .global-search-history-wrap {
                align-items: flex-start;
            }

            .global-search-history-label {
                max-width: 220px;
            }

            .global-search-group-list {
                grid-template-columns: 1fr;
            }

            .print-center-toolbar {
                grid-template-columns: 1fr;
            }
        }

        /* ===== Modal ===== */
        .modal-overlay {
            position: fixed;
            inset: 0;
            background: rgba(1, 10, 18, 0.72);
            backdrop-filter: blur(5px);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 1200;
            padding: 16px;
        }

        .modal-overlay.show {
            display: flex;
        }

        .modal {
            width: min(800px, calc(100vw - 24px));
            max-height: calc(100vh - 40px);
            background: linear-gradient(160deg, rgba(8, 28, 42, 0.98), rgba(8, 19, 31, 0.98));
            border: 1px solid rgba(35, 229, 255, 0.4);
            border-radius: 14px;
            box-shadow: 0 24px 44px rgba(0, 0, 0, 0.48);
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        .modal-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 14px 18px;
            border-bottom: 1px solid rgba(35, 229, 255, 0.2);
            background: linear-gradient(180deg, rgba(8, 35, 50, 0.82), rgba(7, 22, 35, 0.78));
        }

        .modal-head h3 {
            margin: 0;
            font-size: 15px;
            color: #d6fbff;
            font-weight: 700;
        }

        .modal-close {
            width: 28px;
            height: 28px;
            border-radius: 8px;
            border: 1px solid rgba(124, 167, 180, 0.45);
            background: rgba(17, 42, 56, 0.7);
            color: #bfe7ef;
            font-size: 18px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0;
        }

        .modal-close:hover {
            border-color: rgba(255, 191, 74, 0.75);
            color: #ffe2ad;
        }

        .modal-body {
            padding: 18px;
            overflow-y: auto;
            flex: 1;
        }

        .modal-foot {
            padding: 10px 18px;
            border-top: 1px solid rgba(35, 229, 255, 0.2);
            display: flex;
            justify-content: center;
            gap: 8px;
        }

        /* Alert modal — compact variant */
        .modal-alert {
            width: min(340px, calc(100vw - 24px));
        }

        .modal-alert .modal-head {
            padding: 10px 14px;
        }

        .modal-alert .modal-head h3 {
            font-size: 13px;
        }

        .modal-alert .modal-body {
            padding: 12px 14px;
        }

        .modal-alert .modal-foot {
            padding: 8px 14px;
        }

        .modal-alert .modal-foot .btn {
            padding: 6px 14px;
            font-size: 12px;
        }

        .theme-alert {
            display: inline-flex;
            gap: 10px;
            align-items: flex-start;
            padding: 10px 14px;
            border-radius: 10px;
            border: 1px solid rgba(35, 229, 255, 0.2);
            background: linear-gradient(180deg, rgba(7, 28, 41, 0.95), rgba(5, 20, 31, 0.95));
            max-width: 320px;
            width: auto;
            margin: 0 auto;
        }

        .theme-alert.warn {
            border-color: rgba(255, 191, 74, 0.36);
            background: linear-gradient(180deg, rgba(56, 39, 12, 0.9), rgba(35, 24, 8, 0.94));
        }

        .theme-alert.error {
            border-color: rgba(255, 143, 84, 0.34);
            background: linear-gradient(180deg, rgba(58, 25, 12, 0.9), rgba(38, 17, 8, 0.94));
        }

        .theme-alert.success {
            border-color: rgba(66, 248, 208, 0.28);
            background: linear-gradient(180deg, rgba(11, 44, 37, 0.9), rgba(8, 28, 24, 0.94));
        }

        .theme-alert-icon {
            width: 22px;
            height: 22px;
            border-radius: 999px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex: 0 0 22px;
            font-size: 12px;
            font-weight: 800;
            color: #dffcff;
            border: 1px solid rgba(35, 229, 255, 0.28);
            background: rgba(35, 229, 255, 0.1);
        }

        .theme-alert.warn .theme-alert-icon {
            color: #ffe9bc;
            border-color: rgba(255, 191, 74, 0.42);
            background: rgba(255, 191, 74, 0.12);
        }

        .theme-alert.error .theme-alert-icon {
            color: #ffe2d4;
            border-color: rgba(255, 143, 84, 0.42);
            background: rgba(255, 143, 84, 0.12);
        }

        .theme-alert.success .theme-alert-icon {
            color: #dffff3;
            border-color: rgba(66, 248, 208, 0.4);
            background: rgba(66, 248, 208, 0.12);
        }

        .theme-alert-text {
            min-width: 0;
            color: #d8f8ff;
            font-size: 13px;
            line-height: 1.5;
            white-space: pre-wrap;
            word-break: break-word;
        }

        /* ===== Page Sections ===== */
        .page { display: none; }
        .page.active { display: block; }

        /* ===== Log Box ===== */
        .log-box {
            border: 1px solid rgba(35, 229, 255, 0.2);
            border-radius: 10px;
            background: linear-gradient(180deg, rgba(5, 18, 29, 0.86), rgba(4, 13, 22, 0.9));
            padding: 10px;
            max-height: 300px;
            overflow-y: auto;
        }

        .log-entry {
            font-family: "SF Mono", "Menlo", "Consolas", monospace;
            font-size: 12px;
            color: #bfe4ec;
            padding: 8px 10px;
            border-radius: 8px;
            margin-bottom: 6px;
            border: 1px solid rgba(35, 229, 255, 0.18);
            background: rgba(6, 27, 37, 0.62);
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 10px;
        }

        .log-entry-content {
            display: flex;
            flex-direction: column;
            gap: 6px;
            min-width: 0;
            flex: 1;
        }

        .log-entry-head {
            display: flex;
            align-items: center;
            gap: 8px;
            min-width: 0;
            flex-wrap: wrap;
        }

        .log-entry-headline {
            min-width: 0;
            color: #defcff;
            line-height: 1.5;
        }

        .log-entry-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 8px 12px;
            font-size: 11px;
            color: var(--text-muted);
            line-height: 1.5;
        }

        .log-entry-note {
            font-size: 11px;
            line-height: 1.6;
            color: #b7dce6;
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 7px;
            padding: 6px 8px;
            white-space: pre-wrap;
            word-break: break-word;
        }

        .log-entry.warn {
            border-color: rgba(255, 191, 74, 0.34);
            background: rgba(255, 191, 74, 0.2);
            color: #ffe2ad;
        }

        .log-entry.danger {
            border-color: rgba(255, 143, 84, 0.34);
            background: rgba(255, 143, 84, 0.2);
            color: #ffd4ad;
        }

        /* ===== Reminder List ===== */
        .reminder-item {
            border: 1px solid rgba(35, 229, 255, 0.2);
            border-radius: 10px;
            padding: 12px;
            margin-bottom: 8px;
            background: rgba(5, 18, 29, 0.6);
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
        }

        .reminder-item.unread {
            border-color: rgba(94, 182, 255, 0.5);
            background: rgba(94, 182, 255, 0.08);
        }

        .reminder-item .title {
            font-weight: 600;
            color: #d6fbff;
            margin-bottom: 4px;
        }

        .reminder-item .desc {
            font-size: 12px;
            color: var(--text-muted);
        }

        /* ===== Responsive ===== */
        @media (max-width: 980px) {
            .sidebar {
                width: 60px;
            }
            .sidebar .nav-item span:not(.icon),
            .sidebar .nav-section-title,
            .sidebar-logo .version,
            .sidebar-logo h2 {
                display: none;
            }
            .sidebar-logo h2 {
                font-size: 12px;
            }
            .main-content {
                margin-left: 60px;
            }
            .form-row {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 560px) {
            .stats-grid {
                grid-template-columns: repeat(2, 1fr);
            }
            .toolbar .form-group {
                width: 100%;
            }
        }

        /* ===== SVG Icons ===== */
        .icon svg, .icon-svg {
            width: 16px;
            height: 16px;
            fill: none;
            stroke: currentColor;
            stroke-width: 1.8;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        .nav-item .icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 20px;
            height: 20px;
        }

        .nav-item .icon svg {
            width: 18px;
            height: 18px;
        }

        .quick-card .icon-box {
            width: 36px;
            height: 36px;
            border-radius: 10px;
            background: rgba(35, 229, 255, 0.1);
            border: 1px solid rgba(35, 229, 255, 0.25);
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 10px;
        }

        .quick-card .icon-box svg {
            width: 20px;
            height: 20px;
            stroke: var(--line-cyan);
        }

        .empty-icon {
            color: var(--text-muted);
            opacity: 0.5;
            margin: 0 auto 12px;
            width: 48px;
        }

        .empty-icon svg {
            display: block;
            width: 48px;
            height: 48px;
            margin: 0 auto;
            stroke: var(--text-muted);
        }

        /* ===== Quick Actions Grid ===== */
        .quick-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 12px;
        }

        .quick-card {
            border: 1px solid rgba(35, 229, 255, 0.25);
            border-radius: 12px;
            padding: 16px;
            background: linear-gradient(180deg, rgba(9, 36, 50, 0.62), rgba(6, 23, 35, 0.86));
            cursor: pointer;
            transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
        }

        .quick-card:hover {
            border-color: var(--line-cyan);
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(35, 229, 255, 0.2);
        }

        .quick-card h4 {
            margin: 0 0 6px;
            color: #d6fbff;
            font-size: 14px;
        }

        .quick-card p {
            margin: 0;
            font-size: 12px;
            color: var(--text-muted);
        }

        /* ===== Status indicators ===== */
        .status-dot {
            display: inline-block;
            width: 8px;
            height: 8px;
            border-radius: 50%;
            margin-right: 6px;
        }
        .status-dot.green { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
        .status-dot.yellow { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
        .status-dot.red { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
        .status-dot.blue { background: var(--info); box-shadow: 0 0 8px var(--info); }

        /* ===== Visualization ===== */
        .view-tabs {
            display: flex;
            gap: 4px;
            background: rgba(0, 0, 0, 0.2);
            padding: 4px;
            border-radius: 8px;
        }

        .tab-btn {
            padding: 6px 16px;
            border: none;
            background: transparent;
            color: var(--text-muted);
            cursor: pointer;
            border-radius: 6px;
            font-size: 12px;
            transition: all 0.2s;
        }

        .tab-btn:hover {
            color: var(--text-main);
        }

        .tab-btn.active {
            background: var(--line-cyan);
            color: #000;
        }

        .viz-view {
            display: none;
        }

        .viz-view.active {
            display: block;
        }

        .viz-controls {
            position: absolute;
            top: 20px;
            right: 20px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            z-index: 10;
        }

        /* 2D View */
        .viz2d-container {
            display: flex;
            flex-direction: column;
            height: calc(100vh - 80px);
        }

        .viz2d-toolbar {
            display: flex;
            gap: 16px;
            padding: 12px 16px;
            background: rgba(8, 24, 36, 0.8);
            border-bottom: 1px solid var(--border);
        }

        .toolbar-group {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .toolbar-group label {
            margin: 0;
            font-size: 12px;
            color: var(--text-muted);
        }

        .toolbar-group select {
            width: 100px;
            padding: 6px 10px;
            font-size: 12px;
        }

        .viz2d-canvas-container {
            flex: 1;
            position: relative;
            background: #06131d;
            overflow: auto;
        }

        #yard2dCanvas {
            display: block;
            width: 100%;
            height: 100%;
        }

        /* Yard Editor Modal */
        .yard-editor-grid {
            display: grid;
            gap: 2px;
            padding: 16px;
            background: rgba(0, 0, 0, 0.3);
            border-radius: 8px;
            margin-bottom: 16px;
        }

        .yard-cell {
            width: 40px;
            height: 40px;
            background: rgba(35, 229, 255, 0.1);
            border: 1px solid rgba(35, 229, 255, 0.2);
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 10px;
            color: var(--text-muted);
            cursor: pointer;
            transition: all 0.2s;
        }

        .yard-cell:hover {
            background: rgba(35, 229, 255, 0.2);
        }

        .yard-cell.occupied {
            background: rgba(66, 248, 208, 0.3);
            border-color: rgba(66, 248, 208, 0.5);
        }

        .yard-cell.selected {
            border-color: var(--line-cyan);
            box-shadow: 0 0 10px rgba(35, 229, 255, 0.5);
        }

        .yard-cell.warning {
            background: rgba(255, 191, 74, 0.3);
            border-color: rgba(255, 191, 74, 0.5);
        }

        .yard-cell.overdue {
            background: rgba(255, 143, 84, 0.3);
            border-color: rgba(255, 143, 84, 0.5);
        }

        .yard-editor-info {
            display: flex;
            gap: 16px;
            padding: 12px;
            background: rgba(0, 0, 0, 0.2);
            border-radius: 8px;
            margin-bottom: 16px;
        }

        .yard-editor-info .info-item {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 12px;
        }

        .yard-editor-info .color-box {
            width: 20px;
            height: 20px;
            border-radius: 4px;
        }

        .yard-editor-actions {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }

        /* ===== 3D Yard ===== */
        .yard-legend {
            position: absolute;
            bottom: 20px;
            left: 20px;
            background: rgba(8, 24, 36, 0.9);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 12px 16px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            font-size: 12px;
            z-index: 10;
        }

        .legend-item {
            display: flex;
            align-items: center;
            gap: 8px;
            color: var(--text-muted);
        }

        .legend-color {
            width: 16px;
            height: 16px;
            border-radius: 3px;
        }

        /* 顶部工具栏内联图例 */
        .yard-legend-inline {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 0 12px;
            margin-left: auto;
        }

        .legend-item-inline {
            display: flex;
            align-items: center;
            gap: 5px;
            font-size: 12px;
            color: var(--text-muted);
            white-space: nowrap;
        }

        .legend-item-inline .legend-color {
            width: 12px;
            height: 12px;
            border-radius: 3px;
            display: inline-block;
        }

        .yard-tooltip {
            position: absolute;
            background: rgba(8, 24, 36, 0.95);
            border: 1px solid var(--line-cyan);
            border-radius: 8px;
            padding: 12px 16px;
            font-size: 12px;
            color: var(--text-main);
            pointer-events: none;
            z-index: 100;
            display: none;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
        }

        .yard-tooltip.show {
            display: block;
        }

        .yard-tooltip .title {
            font-weight: 700;
            color: var(--line-cyan);
            margin-bottom: 6px;
        }

        .yard-tooltip .info {
            color: var(--text-muted);
            line-height: 1.6;
        }

        /* 右键菜单 */
        .yard-context-menu {
            position: fixed;
            background: rgba(8, 24, 36, 0.96);
            border: 1px solid var(--line-cyan);
            border-radius: 8px;
            padding: 6px 0;
            min-width: 160px;
            z-index: 1000;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(10px);
        }

        .context-menu-item {
            padding: 10px 16px;
            font-size: 13px;
            color: var(--text-main);
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: background 0.15s;
        }

        .context-menu-item:hover {
            background: rgba(35, 229, 255, 0.15);
        }

        .color-dot {
            width: 14px;
            height: 14px;
            border-radius: 50%;
            display: inline-block;
        }

        /* 2D Canvas 容器 */
        .viz2d-canvas-container {
            flex: 1;
            position: relative;
            background: #081018;
            cursor: crosshair;
        }

        #yard2dCanvas {
            width: 100%;
            height: 100%;
            display: block;
        }
