        :root {
            --bg: #f3f6fb;
            --panel: #ffffff;
            --panel-soft: rgba(255, 255, 255, 0.82);
            --text: #18212f;
            --muted: #64748b;
            --line: #e5eaf2;
            --brand: #0b5fff;
            --brand-dark: #0847c7;
            --danger: #c62828;
            --success: #0f9d58;
            --book-green: #004400;
            --book-pill: #08721f;
            --cream: #f5e6d3;
            --shadow: 0 12px 30px rgba(16, 24, 40, 0.08);
        }

        * { box-sizing: border-box; }

        body {
            margin: 0;
            min-height: 100vh;
            background: #003600;
            color: var(--cream);
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
        }

        body.login-page {
            background: #003600;
            color: var(--cream);
        }

        button, input {
            font: inherit;
        }

        button {
            border: 0;
            cursor: pointer;
        }

        .hidden {
            display: none !important;
        }

        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }

        .page {
            width: 100%;
            min-height: 100vh;
            margin: 0;
            padding: 0;
        }

        .card {
            background: var(--panel);
            border: 1px solid var(--line);
            border-radius: 18px;
            padding: 18px;
            box-shadow: var(--shadow);
        }

        .panel {
            background: var(--panel-soft);
            backdrop-filter: blur(10px);
        }

        .section-title {
            margin: 0 0 8px;
            font-size: 22px;
        }

        .section-desc {
            margin: 0 0 18px;
            color: var(--muted);
            font-size: 14px;
            line-height: 1.7;
        }

        .status {
            margin-top: 16px;
            color: var(--muted);
            font-size: 14px;
            line-height: 1.6;
        }

        .status.error {
            color: var(--danger);
        }

        .status.success {
            color: var(--success);
        }

        .field {
            display: flex;
            flex-direction: column;
            gap: 8px;
            margin-bottom: 14px;
        }

        .field label {
            font-size: 14px;
            font-weight: 600;
        }

        .field input {
            width: 100%;
            height: 48px;
            border: 1px solid var(--line);
            border-radius: 12px;
            padding: 0 14px;
            background: #fff;
            color: var(--text);
        }

        .field input:focus {
            border-color: rgba(11, 95, 255, 0.72);
            outline: none;
            box-shadow: 0 0 0 3px rgba(11, 95, 255, 0.12);
        }

        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-height: 44px;
            padding: 0 18px;
            border-radius: 12px;
            text-decoration: none;
            font-size: 15px;
            font-weight: 600;
        }

        .btn-primary {
            background: var(--brand);
            color: #fff;
        }

        .btn-primary:hover {
            background: var(--brand-dark);
        }

        .btn-ghost {
            background: transparent;
            color: var(--muted);
            border: 1px solid var(--line);
        }

        .btn-danger {
            background: #fff1f1;
            color: var(--danger);
        }

        .top-actions {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-top: 14px;
            flex-wrap: wrap;
        }

        .login-card {
            max-width: 480px;
            margin: 40px auto 0;
        }

        body.login-page .login-card {
            background: #003600;
            border-color: rgba(245, 230, 211, 0.38);
            box-shadow: none;
        }

        body.login-page .section-desc,
        body.login-page .status,
        body.login-page .btn-ghost {
            color: var(--cream);
        }

        body.login-page .field input {
            background: #003600;
            border-color: rgba(245, 230, 211, 0.5);
            color: var(--cream);
        }

        body.login-page .field input::placeholder {
            color: rgba(245, 230, 211, 0.62);
        }

        body.login-page .btn-primary {
            background: var(--cream);
            color: #003600;
        }

        body.login-page .btn-primary:hover {
            background: #ffffff;
        }

        body.login-page .btn-ghost {
            border-color: rgba(245, 230, 211, 0.5);
        }

        body.login-page .hospital-item {
            background: #fff;
            color: var(--text);
        }

        body.login-page .hospital-meta {
            color: var(--muted);
        }

        body.login-page .hospital-item .btn-primary {
            background: var(--brand);
            color: #fff;
        }

        body.login-page .page {
            padding: 20px 14px 36px;
        }

        .hospital-list {
            display: grid;
            gap: 12px;
            margin-top: 14px;
        }

        .hospital-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 14px 16px;
            border: 1px solid var(--line);
            border-radius: 14px;
            background: #ffffff;
        }

        .hospital-name {
            font-weight: 600;
        }

        .hospital-meta {
            margin-top: 4px;
            color: var(--muted);
            font-size: 12px;
        }

        .book-shell {
            min-height: 100vh;
            background: #003600;
            color: var(--cream);
        }

        .book-topbar {
            position: relative;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            padding: 12px 24px;
            border-bottom: 1px solid rgba(245, 230, 211, 0.2);
            background: #003600;
            color: var(--cream);
        }

        .book-user {
            min-width: 260px;
            display: grid;
            grid-template-columns: minmax(82px, auto) minmax(130px, 1fr);
            align-items: center;
            gap: 18px;
            font-size: 14px;
            line-height: 1.5;
        }

        .book-user__account {
            min-width: 0;
        }

        .book-user strong {
            display: block;
            color: #fff;
            font-size: 16px;
        }

        .selected-customer {
            display: block;
            min-width: 0;
            margin-top: 0;
            color: #fff;
            font-size: 13px;
            font-weight: 700;
            white-space: nowrap;
        }

        .selected-customer__label {
            display: inline;
        }

        .selected-customer__value {
            display: inline;
        }

        .book-actions {
            position: relative;
            display: flex;
            align-items: flex-end;
            gap: 10px;
        }

        .book-actions__main,
        .book-actions__secondary {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 10px;
        }

        .book-actions__secondary {
            position: absolute;
            left: 0;
            top: calc(100% + 20px);
            flex-direction: column;
            align-items: flex-start;
            z-index: 2;
        }

        .book-actions__secondary .settings-actions {
            justify-content: flex-start;
            margin-top: 0;
        }

        .book-actions__secondary .settings-status {
            max-width: 220px;
            min-height: 16px;
            text-align: left;
        }

        .book-actions .btn-ghost {
            border-color: rgba(245, 230, 211, 0.56);
            color: var(--cream);
        }

        .book-actions .btn-ghost:hover {
            border-color: rgba(245, 230, 211, 0.86);
            color: #fff;
        }

        .book-menu {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 20px;
            overflow-x: auto;
            padding: 2px 0;
        }

        .book-menu-button {
            appearance: none;
            flex: 0 0 auto;
            min-width: 0;
            min-height: 0;
            padding: 0;
            border: 0;
            border-radius: 0;
            background: transparent;
            color: var(--cream);
            font-size: 15px;
            font-weight: 600;
            line-height: normal;
            letter-spacing: 0;
            white-space: nowrap;
        }

        .book-menu-button:hover {
            color: #fff;
        }

        .book-menu-button.is-active {
            color: var(--cream);
            text-decoration: underline;
            text-underline-offset: 3px;
        }

        .book-menu-button.is-disabled {
            color: var(--cream);
        }

        .book-content {
            padding: 22px;
        }

        .book-content--add-actions {
            padding-top: 72px;
        }

        .customer-search-panel {
            min-height: calc(100vh - 118px);
            border-radius: 14px;
            background: #003600;
            color: var(--cream);
            padding: 0;
            overflow: auto;
        }

        .web-search-card {
            border: 1px solid rgba(245, 230, 211, 0.22);
            border-radius: 12px;
            padding: 16px;
            background: rgba(255, 255, 255, 0.06);
            margin-bottom: 16px;
        }

        .web-search-title {
            margin: 0 0 14px;
            color: var(--cream);
            font-size: 18px;
            font-weight: 700;
        }

        .customer-result-note {
            min-height: 20px;
            margin: 10px 0 0;
            color: rgba(245, 230, 211, 0.78);
            font-size: 13px;
        }

        .customer-result-note.error {
            color: #ffb4b4;
        }

        .customer-result-note.success {
            color: #d8ffd8;
        }

        .customer-modal {
            position: fixed;
            inset: 0;
            z-index: 30;
            display: grid;
            place-items: center;
            padding: 24px;
        }

        .customer-modal__backdrop {
            position: absolute;
            inset: 0;
            background: rgba(0, 0, 0, 0.58);
        }

        .customer-modal__panel {
            position: relative;
            z-index: 1;
            width: min(760px, 100%);
            max-height: min(680px, calc(100vh - 48px));
            overflow: auto;
            border: 1px solid rgba(245, 230, 211, 0.28);
            border-radius: 14px;
            background: #003600;
            color: var(--cream);
            padding: 18px;
        }

        .customer-modal__header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 14px;
        }

        .customer-modal__title {
            margin: 0;
            font-size: 18px;
        }

        .customer-list {
            display: grid;
            gap: 10px;
        }

        .customer-choice {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            gap: 12px;
            align-items: center;
            border: 1px solid rgba(245, 230, 211, 0.24);
            border-radius: 10px;
            padding: 12px;
            background: rgba(255, 255, 255, 0.06);
        }

        .customer-choice__name {
            color: #fff;
            font-size: 16px;
            font-weight: 700;
        }

        .customer-choice__meta {
            margin-top: 4px;
            color: rgba(245, 230, 211, 0.74);
            font-size: 13px;
            line-height: 1.5;
        }

        .scan-grid {
            display: grid;
            grid-template-columns: repeat(4, minmax(160px, 1fr)) auto;
            align-items: end;
            gap: 12px;
        }

        .scan-field {
            display: grid;
            gap: 6px;
        }

        .scan-field--wide {
            grid-column: span 2;
        }

        .form-label {
            color: var(--cream);
            font-size: 15px;
            font-weight: 600;
            white-space: nowrap;
        }

        .required::after {
            content: "*";
            margin-left: 3px;
            color: #c62828;
        }

        .book-input,
        .book-select {
            width: 100%;
            height: 38px;
            border: 1px solid rgba(245, 230, 211, 0.36);
            border-radius: 8px;
            padding: 0 10px;
            background: rgba(255, 255, 255, 0.08);
            color: var(--cream);
            font-size: 14px;
        }

        .book-input::placeholder {
            color: rgba(245, 230, 211, 0.48);
        }

        .book-input:disabled,
        .book-select:disabled {
            cursor: not-allowed;
            border-color: rgba(245, 230, 211, 0.2);
            background: rgba(255, 255, 255, 0.04);
            color: rgba(245, 230, 211, 0.62);
            opacity: 1;
        }

        .book-select option {
            background: #003600;
            color: var(--cream);
        }

        .book-input:focus,
        .book-select:focus {
            border-color: rgba(245, 230, 211, 0.8);
            outline: none;
            box-shadow: 0 0 0 3px rgba(245, 230, 211, 0.12);
        }

        .scan-input-wrap {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .scan-button {
            flex: 0 0 auto;
            height: 38px;
            border: 1px solid #d7dee8;
            border-radius: 8px;
            padding: 0 12px;
            background: #f8fafc;
            color: #334155;
            font-weight: 600;
        }

        .search-action {
            height: 38px;
            min-width: 84px;
            border-radius: 8px;
            background: #0b5fff;
            color: #fff;
            font-size: 15px;
            font-weight: 700;
            box-shadow: 0 8px 18px rgba(11, 95, 255, 0.24);
        }

        .profile-form {
            display: grid;
            grid-template-columns: 260px minmax(0, 1fr);
            gap: 16px;
        }

        .profile-side-card,
        .form-card {
            border: 1px solid rgba(245, 230, 211, 0.22);
            border-radius: 12px;
            background: rgba(255, 255, 255, 0.06);
            padding: 16px;
        }

        .profile-side-card {
            align-self: start;
            display: grid;
            gap: 12px;
            justify-items: center;
            background: rgba(255, 255, 255, 0.06);
        }

        .avatar-upload {
            width: 132px;
            height: 132px;
            border-radius: 50%;
            border: 1px dashed rgba(245, 230, 211, 0.42);
            background: rgba(255, 255, 255, 0.1);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0;
            overflow: hidden;
            color: var(--cream);
            font-size: 14px;
            text-align: center;
        }

        .side-hint {
            margin: 0;
            color: rgba(245, 230, 211, 0.78);
            font-size: 13px;
            line-height: 1.5;
            text-align: center;
        }

        .profile-main {
            display: grid;
            gap: 16px;
        }

        .form-card {
            display: grid;
            gap: 14px;
        }

        .form-grid {
            display: grid;
            grid-template-columns: repeat(3, minmax(190px, 1fr));
            gap: 12px 16px;
        }

        .form-row {
            display: grid;
            gap: 6px;
        }

        .form-row--wide {
            grid-column: span 2;
        }

        .image-row {
            display: grid;
            width: 100%;
            grid-template-columns: 1fr;
            gap: 12px;
        }

        .id-card-upload {
            width: 100%;
            height: 112px;
            border: 1px dashed rgba(245, 230, 211, 0.42);
            border-radius: 14px;
            background: rgba(255, 255, 255, 0.1);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0;
            overflow: hidden;
            color: var(--cream);
            font-size: 15px;
            text-align: center;
        }

        .upload-preview {
            display: grid;
            place-items: center;
            position: relative;
            overflow: hidden;
        }

        .upload-preview--avatar {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            border: 0;
            background: rgba(245, 230, 211, 0.08);
        }

        .upload-preview--id-card {
            width: 100%;
            height: 100%;
            border-radius: inherit;
            border: 0;
            background: rgba(245, 230, 211, 0.08);
        }

        .upload-preview img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            position: absolute;
            inset: 0;
        }

        .upload-caption {
            position: relative;
            z-index: 1;
            font-weight: 600;
            line-height: 1.2;
        }

        .upload-caption.sr-only {
            position: absolute;
        }

        .avatar-upload.is-uploaded,
        .id-card-upload.is-uploaded {
            border-style: solid;
            border-color: rgba(216, 255, 216, 0.72);
            background: rgba(216, 255, 216, 0.12);
            color: #d8ffd8;
        }

        .form-section-title {
            margin: 0;
            color: var(--cream);
            font-size: 16px;
            font-weight: 700;
        }

        .settings-shell {
            display: grid;
            grid-template-columns: 1fr;
            gap: 16px;
            min-height: calc(100vh - 118px);
        }

        .settings-shell .form-grid {
            grid-template-columns: repeat(4, minmax(180px, 1fr));
        }

        .settings-actions {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 10px;
            margin-top: 4px;
        }

        .settings-actions .btn {
            min-height: 0;
            height: 40px;
            padding: 0 18px;
            border-radius: 8px;
            font-size: 15px;
            line-height: 1;
        }

        .settings-actions .btn-ghost {
            color: var(--cream);
            border-color: rgba(245, 230, 211, 0.62);
            background: rgba(245, 230, 211, 0.08);
        }

        .settings-actions .btn-ghost:hover {
            border-color: rgba(245, 230, 211, 0.9);
            background: rgba(245, 230, 211, 0.14);
        }

        .settings-status {
            min-height: 20px;
            color: rgba(245, 230, 211, 0.78);
            font-size: 13px;
        }

        .settings-status.error {
            color: #ffb4b4;
        }

        .settings-status.success {
            color: #d8ffd8;
        }

        .settings-table-wrap {
            overflow: auto;
            border: 1px solid rgba(245, 230, 211, 0.2);
            border-radius: 10px;
        }

        .settings-table {
            width: 100%;
            min-width: 860px;
            border-collapse: collapse;
            color: var(--cream);
            font-size: 13px;
        }

        .settings-table th,
        .settings-table td {
            border-bottom: 1px solid rgba(245, 230, 211, 0.16);
            padding: 10px 12px;
            text-align: left;
            white-space: nowrap;
        }

        .settings-table th {
            background: rgba(255, 255, 255, 0.08);
            color: #fff;
            font-weight: 700;
        }

        .settings-table tr {
            cursor: pointer;
        }

        .settings-table tr:hover,
        .settings-table tr.is-selected {
            background: rgba(245, 230, 211, 0.1);
        }

        .settings-card-list {
            display: grid;
            gap: 14px;
        }

        .settings-empty {
            min-height: 96px;
            display: grid;
            place-items: center;
            border: 1px dashed rgba(245, 230, 211, 0.2);
            border-radius: 10px;
            color: rgba(245, 230, 211, 0.72);
            font-size: 14px;
        }

        .settings-result-card {
            display: grid;
            gap: 12px;
            border: 1px solid rgba(245, 230, 211, 0.22);
            border-radius: 10px;
            padding: 14px;
            background: rgba(255, 255, 255, 0.04);
            cursor: pointer;
        }

        .settings-result-card:hover,
        .settings-result-card.is-selected {
            border-color: rgba(245, 230, 211, 0.56);
            background: rgba(245, 230, 211, 0.08);
        }

        .settings-result-card__head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            color: var(--cream);
            font-size: 15px;
            font-weight: 700;
        }

        .settings-result-card__meta {
            color: rgba(245, 230, 211, 0.72);
            font-size: 12px;
            font-weight: 500;
        }

        .settings-list-title-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
        }

        .settings-result-grid {
            display: grid;
            grid-template-columns: repeat(4, minmax(160px, 1fr));
            gap: 10px 14px;
        }

        .card-label {
            display: block;
            margin-bottom: 4px;
            color: rgba(245, 230, 211, 0.68);
            font-size: 12px;
            font-weight: 600;
        }

        .settings-result-grid .form-row--wide {
            grid-column: span 2;
        }

        .placeholder {
            min-height: 360px;
            display: grid;
            place-items: center;
            border: 1px dashed #cbd5e1;
            border-radius: 16px;
            background: #fff;
            color: var(--muted);
            font-size: 18px;
            text-align: center;
        }

        @media (max-width: 760px) {
            .book-topbar {
                align-items: stretch;
                flex-direction: column;
            }

            .book-menu-button {
                font-size: 15px;
            }

            .book-content {
                padding: 14px;
            }

            .customer-search-panel {
                padding: 18px 14px;
            }

            .scan-grid,
            .profile-form,
            .form-grid,
            .settings-shell {
                grid-template-columns: 1fr;
            }

            .scan-field--wide,
            .form-row--wide {
                grid-column: auto;
            }

            .image-row {
                grid-template-columns: 1fr;
            }
        }
