:root {
    --bg: #f4f6f7;
    --surface: #ffffff;
    --surface-subtle: #f8faf9;
    --surface-muted: #eef2f1;
    --border: #d9e0de;
    --border-strong: #bcc9c5;
    --text: #17211e;
    --text-soft: #52615c;
    --text-muted: #77837f;
    --primary: #176b5b;
    --primary-hover: #105849;
    --primary-soft: #e3f2ed;
    --blue: #276a8e;
    --blue-soft: #e7f1f6;
    --green: #1f7a4f;
    --green-soft: #e5f4eb;
    --amber: #966313;
    --amber-soft: #fbf1d9;
    --red: #b23a3a;
    --red-soft: #fae9e9;
    --shadow: 0 12px 34px rgba(21, 37, 32, 0.1);
    --sidebar-width: 236px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background: var(--bg);
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    min-width: 320px;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: 0;
}

button,
input,
select,
textarea {
    color: inherit;
    font: inherit;
    letter-spacing: 0;
}

button {
    border: 0;
}

button,
label,
select {
    -webkit-tap-highlight-color: transparent;
}

button:not(:disabled),
select:not(:disabled) {
    cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

h1,
h2,
h3,
h4,
p {
    margin: 0;
}

svg {
    display: block;
    width: 18px;
    height: 18px;
    stroke-width: 1.8;
}

.is-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;
}

.startup {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-soft);
    background: var(--bg);
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-strong);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.auth-layout {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--bg);
}

.auth-panel {
    width: min(100%, 420px);
    padding: 30px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.auth-brand,
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
}

.auth-brand {
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.brand-mark {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--primary);
    border-radius: 7px;
}

.brand-mark.compact {
    width: 36px;
    height: 36px;
}

.brand-title {
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
}

.brand-caption {
    margin-top: 1px;
    color: var(--text-muted);
    font-size: 12px;
}

.auth-heading {
    padding: 25px 0 20px;
}

.auth-heading h1 {
    font-size: 22px;
    line-height: 1.3;
}

.auth-heading p {
    margin-top: 6px;
    color: var(--text-soft);
}

.stack-form {
    display: grid;
    gap: 16px;
}

.field {
    display: grid;
    gap: 7px;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 600;
}

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

.field > input,
.field > select,
.field > textarea {
    width: 100%;
    padding: 9px 11px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    outline: none;
}

.field > input,
.field > select {
    height: 42px;
}

.field > textarea {
    min-height: 82px;
    resize: vertical;
}

.field > input:focus,
.field > select:focus,
.field > textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(23, 107, 91, 0.12);
}

.field em {
    color: var(--text-muted);
    font-style: normal;
    font-weight: 400;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrap > svg {
    position: absolute;
    left: 12px;
    z-index: 1;
    width: 17px;
    color: var(--text-muted);
    pointer-events: none;
}

.input-wrap input {
    width: 100%;
    height: 42px;
    padding: 0 12px 0 39px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.input-wrap.has-action input,
.query-input input {
    padding-right: 44px;
}

.input-wrap input:focus,
.filter-bar input:focus,
.filter-bar select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(23, 107, 91, 0.12);
}

.input-icon-button {
    position: absolute;
    right: 6px;
    z-index: 2;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    color: var(--text-muted);
    background: transparent;
    border-radius: 5px;
}

.input-icon-button:hover {
    color: var(--text);
    background: var(--surface-muted);
}

.button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-weight: 650;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.button svg {
    width: 17px;
    height: 17px;
}

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

.button.primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.button.secondary {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border-strong);
}

.button.secondary:hover:not(:disabled) {
    background: var(--surface-subtle);
    border-color: #9eadA8;
}

.button.danger {
    color: #fff;
    background: var(--red);
}

.button.danger:hover:not(:disabled) {
    background: #942d2d;
}

.button.secondary.danger-outline {
    color: var(--red);
    border-color: #e5baba;
}

.button.secondary.danger-outline:hover:not(:disabled) {
    background: var(--red-soft);
    border-color: #d99f9f;
}

.button.full-width {
    width: 100%;
}

.button.is-loading svg {
    animation: spin 0.75s linear infinite;
}

.form-error {
    padding: 9px 11px;
    color: #8f2525;
    background: var(--red-soft);
    border: 1px solid #efcaca;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.auth-footnote {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 22px;
    color: var(--text-muted);
    font-size: 12px;
}

.auth-footnote svg {
    width: 15px;
    height: 15px;
}

.auth-shortcuts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.auth-shortcuts a {
    min-width: 0;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) 14px;
    align-items: center;
    gap: 8px;
    padding: 11px;
    color: var(--text);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 7px;
    text-decoration: none;
}

.auth-shortcuts a:hover {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: #a9cfc5;
}

.auth-shortcuts a > svg:first-child { color: var(--primary); }
.auth-shortcuts a > svg:last-child { width: 14px; color: var(--text-muted); }
.auth-shortcuts span,
.auth-shortcuts strong,
.auth-shortcuts small { min-width: 0; display: block; }
.auth-shortcuts strong { font-size: 13px; }
.auth-shortcuts small { margin-top: 2px; color: var(--text-muted); font-size: 10px; line-height: 1.35; }

.workspace {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    background: #1c2925;
    color: #e9f0ed;
    border-right: 1px solid #2d3e38;
}

.sidebar-brand {
    min-height: 72px;
    padding: 15px 16px;
    border-bottom: 1px solid #30403b;
}

.sidebar .brand-title {
    color: #f7faf9;
}

.sidebar .brand-caption {
    color: #9bada7;
}

.sidebar-close {
    display: none !important;
    margin-left: auto;
    color: #dbe4e1 !important;
}

.nav-list {
    flex: 1;
    overflow-y: auto;
    padding: 14px 10px;
}

.nav-label {
    padding: 12px 10px 6px;
    color: #82978f;
    font-size: 11px;
    font-weight: 700;
}

.nav-item {
    width: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin: 2px 0;
    color: #bbcac5;
    background: transparent;
    border-radius: 6px;
    text-align: left;
    text-decoration: none;
}

.nav-item:hover {
    color: #fff;
    background: #263732;
}

.nav-item.is-active {
    color: #fff;
    background: #31554a;
}

.nav-item svg {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
}

.nav-badge {
    margin-left: auto;
    padding: 1px 5px;
    color: #d1dcd8;
    background: #3b4945;
    border-radius: 4px;
    font-size: 10px;
}

.sidebar-account {
    min-height: 68px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px;
    border-top: 1px solid #30403b;
}

.account-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: #f2faf7;
    background: #45695e;
    border-radius: 50%;
    font-weight: 700;
}

.account-copy {
    min-width: 0;
    flex: 1;
    display: grid;
}

.account-copy strong,
.account-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-copy strong {
    color: #f3f7f5;
    font-size: 13px;
}

.account-copy span {
    color: #94aaa2;
    font-size: 11px;
}

.icon-button {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: var(--text-soft);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
}

.icon-button:hover:not(:disabled) {
    color: var(--text);
    background: var(--surface-muted);
}

.sidebar-account .icon-button:hover {
    color: #fff;
    background: #30443d;
}

.workspace-main {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 26px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--border);
}

.topbar-title {
    min-width: 0;
    flex: 1;
}

.topbar-title h1 {
    font-size: 18px;
    line-height: 1.3;
}

.topbar-title p {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 12px;
}

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

.environment-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-soft);
    font-size: 12px;
}

.status-dot {
    width: 7px;
    height: 7px;
    background: #33a36b;
    border-radius: 50%;
    box-shadow: 0 0 0 3px #e0f4e9;
}

.content {
    width: min(100%, 1440px);
    margin: 0 auto;
    padding: 24px 26px 42px;
}

.view {
    display: none;
}

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

.query-panel,
.data-panel,
.filter-bar,
.phase-notice,
.operation-list,
.advice-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.query-panel {
    padding: 18px;
}

.diagnose-mode-switch {
    width: fit-content;
    min-height: 40px;
    display: flex;
    gap: 3px;
    padding: 3px;
    margin-bottom: 14px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 7px;
}

.diagnose-mode-switch button {
    min-width: 132px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 5px 12px;
    color: var(--text-soft);
    background: transparent;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 650;
}

.diagnose-mode-switch button.is-active {
    color: var(--text);
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(23, 33, 30, 0.12);
}

.diagnose-mode-switch button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.diagnose-mode-switch svg {
    width: 15px;
    height: 15px;
}

.mode-count {
    min-width: 19px;
    height: 19px;
    display: inline-grid;
    place-items: center;
    padding: 0 5px;
    color: #fff;
    background: var(--red);
    border-radius: 9px;
    font-size: 10px;
}

.query-row {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto;
    align-items: center;
    gap: 12px;
}

.query-input input {
    height: 44px;
    font-size: 15px;
}

.segmented-control {
    height: 38px;
    display: inline-flex;
    padding: 3px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 7px;
}

.segmented-control label {
    position: relative;
}

.segmented-control input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented-control span {
    height: 30px;
    display: flex;
    align-items: center;
    padding: 0 11px;
    color: var(--text-soft);
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.segmented-control input:checked + span {
    color: var(--text);
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(23, 33, 30, 0.12);
}

.segmented-control input:focus-visible + span {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.query-submit {
    min-height: 44px;
}

.query-hint {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 12px;
}

.empty-state {
    display: grid;
    justify-items: center;
    text-align: center;
    color: var(--text-soft);
}

.empty-state.prominent {
    min-height: 350px;
    align-content: center;
    padding: 48px 20px;
}

.empty-icon {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 50%;
}

.empty-icon svg {
    width: 24px;
    height: 24px;
}

.empty-state h3 {
    color: var(--text);
    font-size: 16px;
}

.empty-state p {
    max-width: 500px;
    margin-top: 6px;
}

.diagnose-loading {
    display: grid;
    gap: 20px;
    padding-top: 24px;
}

.loading-line,
.loading-block,
.loading-metrics span {
    position: relative;
    overflow: hidden;
    background: #e7ecea;
}

.loading-line {
    width: 34%;
    height: 46px;
    border-radius: 6px;
}

.loading-metrics span {
    min-height: 92px;
    border-radius: 7px;
}

.loading-block {
    height: 190px;
    border-radius: 8px;
}

.loading-line::after,
.loading-block::after,
.loading-metrics span::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 34%;
    background: rgba(255, 255, 255, 0.54);
    transform: translateX(-100%);
    animation: shimmer 1.25s infinite;
}

@keyframes shimmer {
    to { transform: translateX(300%); }
}

.diagnose-result {
    padding-top: 22px;
}

.result-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 17px;
}

.eyebrow {
    color: var(--primary);
    font-size: 11px;
    font-weight: 750;
}

.result-heading h3 {
    margin-top: 2px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 18px;
    overflow-wrap: anywhere;
}

.result-heading p:last-child {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 12px;
}

.health-badge,
.readonly-badge,
.locked-state,
.status-chip,
.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

.health-badge {
    min-height: 30px;
    padding: 5px 9px;
}

.health-badge svg,
.readonly-badge svg,
.locked-state svg,
.status-chip svg {
    width: 14px;
    height: 14px;
}

.health-badge.healthy,
.status-chip.success {
    color: var(--green);
    background: var(--green-soft);
}

.health-badge.warning,
.status-chip.warning {
    color: var(--amber);
    background: var(--amber-soft);
}

.health-badge.danger,
.status-chip.danger {
    color: var(--red);
    background: var(--red-soft);
}

.health-badge.neutral,
.status-chip.neutral {
    color: var(--text-soft);
    background: var(--surface-muted);
}

.result-section { padding: 0; }
.advice-panel { padding: 18px; }

.result-section + .result-section {
    margin-top: 18px;
}

.section-heading,
.page-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.section-heading {
    margin-bottom: 14px;
}

.section-heading h3,
.page-tools h2 {
    font-size: 15px;
    line-height: 1.35;
}

.section-heading p,
.page-tools p {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 12px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.metric-card {
    min-width: 0;
    min-height: 88px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    padding: 12px;
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: 7px;
}

.metric-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 11px;
}

.metric-label svg {
    width: 14px;
    height: 14px;
}

.metric-value {
    overflow: hidden;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric-value.positive { color: var(--green); }
.metric-value.warning { color: var(--amber); }
.metric-value.negative { color: var(--red); }

.device-cards-section {
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid var(--border);
}

.device-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.device-card-item {
    min-width: 0;
    display: grid;
    gap: 12px;
    padding: 14px;
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: 7px;
}

.device-card-heading,
.device-card-badges,
.device-card-slot,
.device-card-meta {
    display: flex;
    align-items: center;
}

.device-card-heading {
    justify-content: space-between;
    gap: 10px;
}

.device-card-slot {
    min-width: 0;
    gap: 7px;
}

.device-card-slot svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.device-card-slot strong {
    font-size: 13px;
}

.device-card-badges {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
}

.status-chip.current {
    color: var(--blue);
    background: var(--blue-soft);
}

.device-card-identity {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 30px;
    align-items: center;
    gap: 9px;
}

.device-card-identity > span {
    color: var(--text-muted);
    font-size: 11px;
}

.device-card-identity strong {
    min-width: 0;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.device-card-copy {
    width: 30px;
    height: 30px;
}

.device-card-meta {
    flex-wrap: wrap;
    gap: 7px 14px;
    color: var(--text-muted);
    font-size: 11px;
}

.device-card-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding-top: 11px;
    border-top: 1px solid var(--border);
}

.device-card-control {
    width: 100%;
    min-height: 32px;
    padding: 6px 10px;
    font-size: 12px;
}

.result-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(290px, 0.8fr);
    gap: 18px;
    margin-top: 18px;
}

.issues-section,
.advice-panel {
    min-height: 205px;
}

.count-badge {
    min-width: 25px;
    height: 24px;
    padding: 0 7px;
    color: var(--text-soft);
    background: var(--surface-muted);
}

.issue-list {
    display: grid;
    gap: 8px;
}

.issue-item {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 9px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
}

.issue-item:first-child {
    padding-top: 0;
    border-top: 0;
}

.issue-symbol {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 6px;
}

.issue-symbol svg {
    width: 16px;
    height: 16px;
}

.issue-item.danger .issue-symbol { color: var(--red); background: var(--red-soft); }
.issue-item.warning .issue-symbol { color: var(--amber); background: var(--amber-soft); }
.issue-item.info .issue-symbol { color: var(--blue); background: var(--blue-soft); }
.issue-item.success .issue-symbol { color: var(--green); background: var(--green-soft); }

.issue-copy strong {
    display: block;
    font-size: 13px;
}

.issue-copy p {
    margin-top: 2px;
    color: var(--text-soft);
    font-size: 12px;
}

.compact-heading {
    align-items: flex-start;
}

.readonly-badge {
    padding: 4px 7px;
    color: var(--blue);
    background: var(--blue-soft);
}

.advice-list {
    display: grid;
    gap: 10px;
    padding: 0;
    margin: 0;
    list-style: none;
    counter-reset: advice;
}

.advice-list li {
    position: relative;
    min-height: 25px;
    padding: 3px 0 3px 33px;
    color: var(--text-soft);
    font-size: 12px;
    counter-increment: advice;
}

.advice-list li::before {
    content: counter(advice);
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
}

.operation-center {
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid var(--border);
}

.operation-heading {
    align-items: flex-start;
}

.secure-action-badge {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    color: var(--green);
    background: var(--green-soft);
    border-radius: 5px;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

.secure-action-badge svg,
.operation-security-note svg {
    width: 15px;
    height: 15px;
}

.operation-security-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
    color: var(--blue);
    background: var(--blue-soft);
    border: 1px solid #cfe2eb;
    border-radius: 6px;
    font-size: 12px;
}

.operation-security-note svg {
    flex: 0 0 auto;
    margin-top: 1px;
}

.contextual-action-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.contextual-action-card {
    min-width: 0;
    min-height: 142px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-content: start;
    gap: 10px;
    padding: 13px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 7px;
}

.contextual-action-card > div {
    min-width: 0;
}

.contextual-action-card strong {
    display: block;
    font-size: 13px;
}

.contextual-action-card p {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 11px;
    overflow-wrap: anywhere;
}

.contextual-action-button {
    grid-column: 1 / -1;
    align-self: end;
    width: 100%;
    min-height: 34px;
    margin-top: auto;
    padding: 6px 9px;
    font-size: 11px;
}

.inline-empty {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 16px;
    color: var(--text-muted);
    background: var(--surface-subtle);
    border: 1px dashed var(--border-strong);
    border-radius: 6px;
    font-size: 12px;
    text-align: center;
}

.inline-empty svg {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
}

.operation-subsection {
    padding-top: 18px;
    margin-top: 18px;
    border-top: 1px solid var(--border);
    scroll-margin-top: 92px;
}

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

.subsection-heading h4 {
    font-size: 14px;
}

.subsection-heading p {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 11px;
}

.receipt-list {
    border-top: 1px solid var(--border);
}

.receipt-row {
    min-width: 0;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 11px 2px;
    border-bottom: 1px solid var(--border);
}

.receipt-icon {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 6px;
}

.receipt-icon svg {
    width: 16px;
    height: 16px;
}

.receipt-icon.success { color: var(--green); background: var(--green-soft); }
.receipt-icon.warning { color: var(--amber); background: var(--amber-soft); }
.receipt-icon.danger { color: var(--red); background: var(--red-soft); }

.receipt-row > div {
    min-width: 0;
}

.receipt-row > div > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.receipt-row strong {
    font-size: 12px;
}

.receipt-row p {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 11px;
    overflow-wrap: anywhere;
}

.receipt-row time {
    color: var(--text-muted);
    font-size: 10px;
    white-space: nowrap;
}

.details-section {
    margin-top: 18px;
}

.tab-list {
    display: flex;
    gap: 3px;
    overflow-x: auto;
    padding-bottom: 1px;
    border-bottom: 1px solid var(--border);
}

.tab-button {
    min-height: 37px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    color: var(--text-soft);
    background: transparent;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.tab-button svg {
    width: 15px;
    height: 15px;
}

.tab-button:hover {
    color: var(--text);
    background: var(--surface-subtle);
}

.tab-button.is-active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.detail-panel {
    display: none;
    min-height: 128px;
    padding-top: 16px;
}

.detail-panel.is-active {
    display: block;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 24px;
}

.detail-row {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(72px, 0.8fr) minmax(90px, 1.2fr);
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid #e7ecea;
}

.detail-row dt {
    color: var(--text-muted);
    font-size: 12px;
}

.detail-row dd {
    margin: 0;
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    overflow-wrap: anywhere;
    text-align: right;
}

.detail-empty {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--text-muted);
    font-size: 12px;
}

.detail-empty svg {
    width: 16px;
    height: 16px;
}

.recharge-table {
    min-width: 1120px;
}

.recharge-table th,
.recharge-table td {
    padding: 10px 12px;
}

.recharge-table .recharge-package-cell {
    min-width: 180px;
    max-width: 260px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.recharge-sync-note {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 11px;
}

.recharge-sync-note svg {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
}

.recharge-sync-note.is-warning {
    color: var(--amber);
}

@media (max-width: 680px) {
    .recharge-table {
        min-width: 0;
    }

    .recharge-table thead {
        display: none;
    }

    .recharge-table tbody {
        display: grid;
        gap: 8px;
    }

    .recharge-table tr {
        display: grid;
        padding: 8px 10px;
        border: 1px solid var(--border);
        border-radius: 6px;
    }

    .recharge-table td,
    .recharge-table .recharge-package-cell {
        min-width: 0;
        max-width: none;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding: 7px 0;
        border-bottom: 1px solid var(--border);
        white-space: normal;
        text-align: right;
        overflow-wrap: anywhere;
    }

    .recharge-table td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        color: var(--text-muted);
        font-size: 11px;
        font-weight: 600;
    }

    .recharge-table td:last-child {
        border-bottom: 0;
    }
}

.page-tools {
    margin-bottom: 16px;
}

.page-tools h2 {
    font-size: 18px;
}

.data-panel {
    overflow: hidden;
}

.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

th,
td {
    min-width: 110px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

th {
    color: var(--text-muted);
    background: var(--surface-subtle);
    font-size: 11px;
    font-weight: 700;
}

td {
    color: var(--text-soft);
    font-size: 12px;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover td {
    background: #fafcfb;
}

td strong {
    color: var(--text);
    font-size: 13px;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.align-right {
    text-align: right;
}

.table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
}

.table-button {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    color: var(--text-soft);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 11px;
}

.table-button:hover {
    color: var(--text);
    background: var(--surface-muted);
}

.table-button.danger {
    color: var(--red);
}

.table-button svg {
    width: 13px;
    height: 13px;
}

.table-empty {
    min-height: 210px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
}

.table-loading td {
    height: 52px;
    color: var(--text-muted);
    text-align: center;
}

.pagination {
    min-height: 49px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 8px 14px;
    border-top: 1px solid var(--border);
}

.pagination:empty {
    display: none;
}

.pagination-info {
    margin-right: auto;
    color: var(--text-muted);
    font-size: 11px;
}

.page-button {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    color: var(--text-soft);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 5px;
}

.page-button:hover:not(:disabled) {
    background: var(--surface-muted);
}

.page-button svg {
    width: 15px;
    height: 15px;
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(170px, 0.7fr) minmax(150px, 0.6fr) auto;
    align-items: end;
    gap: 12px;
    margin-bottom: 14px;
    padding: 14px;
}

.followup-panel {
    display: grid;
    gap: 14px;
}

.followup-heading-row {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.section-heading-spaced {
    margin-top: 28px;
}

.inventory-import-section {
    display: grid;
    gap: 14px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.inventory-import-heading {
    display: flex;
    align-items: center;
    gap: 11px;
}

.inventory-import-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 7px;
}

.inventory-import-icon svg {
    width: 19px;
    height: 19px;
}

.inventory-import-heading h3 {
    font-size: 16px;
}

.inventory-import-heading p {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 12px;
}

.inventory-import-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 12px;
    padding: 14px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 7px;
}

.inventory-file-field {
    min-width: 0;
    display: grid;
    gap: 6px;
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 650;
}

.inventory-file-field input[type="file"] {
    min-width: 0;
    width: 100%;
    min-height: 40px;
    padding: 5px 7px;
    color: var(--text-soft);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    font-size: 12px;
}

.inventory-file-field input[type="file"]::file-selector-button {
    min-height: 28px;
    margin-right: 9px;
    padding: 0 10px;
    color: var(--primary);
    background: var(--primary-soft);
    border: 0;
    border-radius: 5px;
    font-weight: 650;
    cursor: pointer;
}

.inventory-file-field small {
    color: var(--text-muted);
    font-weight: 450;
}

.inventory-import-preview {
    display: grid;
    gap: 13px;
    padding: 14px;
    border: 1px solid #bfdcce;
    border-radius: 7px;
    background: #f7fbf9;
}

.inventory-preview-title,
.inventory-preview-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.inventory-preview-title > div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.inventory-preview-title span {
    color: var(--green);
    font-size: 11px;
    font-weight: 700;
}

.inventory-preview-title strong {
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inventory-preview-summary {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 7px;
}

.inventory-preview-summary > div {
    min-width: 0;
    display: grid;
    align-content: center;
    gap: 3px;
    min-height: 68px;
    padding: 10px 12px;
    border-right: 1px solid var(--border);
}

.inventory-preview-summary > div:last-child {
    border-right: 0;
}

.inventory-preview-summary span {
    color: var(--text-muted);
    font-size: 10px;
}

.inventory-preview-summary strong {
    font-size: 20px;
}

.inventory-preview-plan {
    display: grid;
    gap: 6px;
    padding: 10px 12px;
    color: var(--text-soft);
    background: var(--blue-soft);
    border: 1px solid #c9dce6;
    border-radius: 6px;
    font-size: 12px;
}

.inventory-preview-plan > div {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text);
    font-weight: 650;
}

.inventory-preview-plan svg {
    width: 15px;
    height: 15px;
}

.inventory-preview-actions {
    justify-content: flex-end;
}

.wechat-order-upload {
    display: grid;
    gap: 14px;
    margin-bottom: 24px;
    padding: 18px 0 22px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.wechat-order-upload-heading {
    display: flex;
    align-items: center;
    gap: 11px;
}

.wechat-order-upload-heading > span {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 7px;
}

.wechat-order-upload-heading svg {
    width: 19px;
    height: 19px;
}

.wechat-order-upload-heading h3,
.wechat-order-history-heading h3 {
    font-size: 16px;
}

.wechat-order-upload-heading p,
.wechat-order-history-heading p {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 12px;
}

.wechat-order-import-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 12px;
    padding: 14px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 7px;
}

.wechat-order-file-field {
    min-width: 0;
    display: grid;
    gap: 6px;
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 650;
}

.wechat-order-file-field input[type="file"] {
    min-width: 0;
    width: 100%;
    min-height: 40px;
    padding: 5px 7px;
    color: var(--text-soft);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    font-size: 12px;
}

.wechat-order-file-field input[type="file"]::file-selector-button {
    min-height: 28px;
    margin-right: 9px;
    padding: 0 10px;
    color: var(--primary);
    background: var(--primary-soft);
    border: 0;
    border-radius: 5px;
    font-weight: 650;
    cursor: pointer;
}

.wechat-order-file-field small {
    color: var(--text-muted);
    font-weight: 450;
}

.wechat-order-preview {
    display: grid;
    gap: 13px;
    padding: 14px;
    background: #f7fbf9;
    border: 1px solid #bfdcce;
    border-radius: 7px;
}

.wechat-order-preview-title,
.wechat-order-preview-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.wechat-order-preview-title > div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.wechat-order-preview-title > div > span {
    color: var(--green);
    font-size: 11px;
    font-weight: 700;
}

.wechat-order-preview-title strong {
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wechat-order-preview-summary {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 7px;
}

.wechat-order-preview-summary > div {
    min-width: 0;
    min-height: 68px;
    display: grid;
    align-content: center;
    gap: 3px;
    padding: 10px 12px;
    border-right: 1px solid var(--border);
}

.wechat-order-preview-summary > div:last-child {
    border-right: 0;
}

.wechat-order-preview-summary span {
    color: var(--text-muted);
    font-size: 10px;
}

.wechat-order-preview-summary strong {
    font-size: 20px;
}

.wechat-order-preview-note {
    display: grid;
    gap: 6px;
    padding: 10px 12px;
    color: var(--text-soft);
    background: var(--amber-soft);
    border: 1px solid #ead29e;
    border-radius: 6px;
    font-size: 12px;
}

.wechat-order-preview-note > div {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text);
    font-weight: 650;
}

.wechat-order-preview-note svg {
    width: 15px;
    height: 15px;
}

.wechat-order-preview-actions {
    justify-content: flex-end;
}

.wechat-order-history-heading {
    margin-bottom: 12px;
}

.wechat-order-history-table {
    min-width: 1280px;
}

.followup-heading-row h3 {
    font-size: 17px;
}

.followup-heading-row p {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 12px;
}

.shipments-page-tools {
    margin-bottom: 14px;
}

.page-tool-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shipment-view-switch {
    margin: 0;
}

.shipment-view-switch span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.shipment-view-switch svg {
    width: 15px;
    height: 15px;
}

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

.shipments-tabs {
    margin-bottom: 0;
}

.shipment-search {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shipment-search .input-wrap {
    width: min(320px, 42vw);
}

.shipment-search input {
    width: 100%;
    height: 40px;
}

.shipments-table-scroll {
    max-height: calc(100vh - 310px);
}

.shipment-univer-panel {
    min-width: 0;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.shipment-univer-controls {
    min-height: 46px;
    padding: 7px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-subtle);
}

.shipment-page-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

#shipment-page-label {
    min-width: 112px;
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
}

#shipment-univer-container {
    height: clamp(520px, calc(100vh - 330px), 780px);
}

.shipments-table-scroll thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface-subtle);
}

#shipments-table th,
#shipments-table td {
    min-width: 128px;
    max-width: 300px;
    white-space: normal;
    overflow-wrap: anywhere;
}

#shipments-table th:first-child,
#shipments-table td:first-child {
    min-width: 76px;
    width: 76px;
}

.shared-cell-input {
    width: 100%;
    min-width: 112px;
    padding: 6px 7px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    outline: none;
}

.shared-cell-input:hover {
    border-color: var(--border);
    background: var(--surface);
}

.shared-cell-input:focus {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 2px rgba(23, 107, 91, 0.12);
}

#shipments-table tr.is-saving {
    opacity: 0.68;
}

#shipments-table tr.is-saved td {
    background: var(--green-soft);
}

.shared-row-actions {
    min-width: 58px !important;
    width: 58px;
    text-align: center;
}

.shared-row-actions .icon-button {
    margin: 0 auto;
}

@media (max-width: 720px) {
    .shipments-page-tools,
    .page-tool-actions,
    .shipments-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .shipment-view-switch {
        width: 100%;
    }

    #shipment-univer-container {
        height: calc(100vh - 390px);
        min-height: 460px;
    }

    .shipment-search .input-wrap {
        width: 100%;
    }

    .shipment-search .button {
        flex: 0 0 auto;
    }
}

.followup-toolbar {
    display: grid;
    grid-template-columns: minmax(180px, 300px) auto auto;
    justify-content: start;
    align-items: end;
    gap: 12px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.compact-field {
    display: grid;
    gap: 5px;
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 650;
}

.compact-field input,
.compact-field select {
    width: 100%;
    height: 38px;
    padding: 0 10px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    outline: none;
}

.compact-field input:focus,
.compact-field select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(23, 107, 91, 0.12);
}

.followup-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.followup-summary > div {
    min-width: 0;
    min-height: 82px;
    display: grid;
    align-content: center;
    gap: 4px;
    padding: 14px 18px;
    border-right: 1px solid var(--border);
}

.followup-summary > div:last-child {
    border-right: 0;
}

.followup-summary span {
    color: var(--text-muted);
    font-size: 11px;
}

.followup-summary strong {
    color: var(--text);
    font-size: 23px;
    line-height: 1.15;
}

.followup-sync {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    color: var(--text-soft);
    background: var(--blue-soft);
    border: 1px solid #c9dce6;
    border-radius: 6px;
    font-size: 12px;
}

.followup-sync.success {
    color: var(--green);
    background: var(--green-soft);
    border-color: #c4e1d0;
}

.followup-sync.warning {
    color: var(--amber);
    background: var(--amber-soft);
    border-color: #ead39f;
}

.followup-sync.danger {
    color: var(--red);
    background: var(--red-soft);
    border-color: #e7bcbc;
}

.followup-sync svg {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
}

.followup-table th,
.followup-table td {
    min-width: 125px;
}

.followup-table th:nth-child(2),
.followup-table td:nth-child(2) {
    min-width: 210px;
}

.followup-table .followup-action-column {
    position: sticky;
    right: 0;
    z-index: 2;
    min-width: 88px;
    background: var(--surface);
    box-shadow: -8px 0 12px rgba(18, 35, 29, 0.06);
}

.followup-table th.followup-action-column {
    z-index: 3;
    background: var(--surface-subtle);
}

.daily-recharge-panel {
    display: grid;
    gap: 14px;
}

.recharge-summary-panel {
    display: grid;
    gap: 14px;
}

.recharge-summary-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 12px;
    padding: 14px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 7px;
}

.recharge-summary-file-field {
    min-width: 0;
    display: grid;
    gap: 6px;
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 650;
}

.recharge-summary-file-field input[type="file"] {
    min-width: 0;
    width: 100%;
    min-height: 40px;
    padding: 5px 7px;
    color: var(--text-soft);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    font-size: 12px;
}

.recharge-summary-file-field input[type="file"]::file-selector-button {
    min-height: 28px;
    margin-right: 9px;
    padding: 0 10px;
    color: var(--primary);
    background: var(--primary-soft);
    border: 0;
    border-radius: 5px;
    font-weight: 650;
    cursor: pointer;
}

.recharge-summary-file-field small {
    overflow: hidden;
    color: var(--text-muted);
    font-weight: 450;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recharge-summary-preview {
    display: grid;
    gap: 12px;
    padding-top: 2px;
}

.recharge-summary-preview-heading,
.recharge-summary-preview-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.recharge-summary-preview-heading > div {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.recharge-summary-preview-heading span,
.recharge-summary-preview-note {
    color: var(--text-muted);
    font-size: 11px;
}

.recharge-summary-preview-heading strong {
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recharge-summary-preview-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 7px;
}

.recharge-summary-preview-metrics > div {
    min-width: 0;
    min-height: 72px;
    display: grid;
    align-content: center;
    gap: 4px;
    padding: 11px 14px;
    border-right: 1px solid var(--border);
}

.recharge-summary-preview-metrics > div:last-child { border-right: 0; }
.recharge-summary-preview-metrics span { color: var(--text-muted); font-size: 11px; }
.recharge-summary-preview-metrics strong { color: var(--text); font-size: 19px; line-height: 1.2; }
.recharge-summary-preview-data { max-height: 430px; overflow: auto; }
.recharge-summary-preview-table { min-width: 680px; }
.recharge-summary-preview-table th:first-child,
.recharge-summary-preview-table td:first-child { width: 68px; }
.recharge-summary-preview-table th:nth-child(3),
.recharge-summary-preview-table td:nth-child(3) { width: 120px; }
.recharge-summary-preview-table th:nth-child(4),
.recharge-summary-preview-table td:nth-child(4) { width: 110px; }
.recharge-summary-preview-note { min-height: 16px; margin: 0; }
.recharge-summary-preview-actions { justify-content: flex-end; }

.daily-recharge-toolbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(150px, 0.7fr)) auto;
    align-items: end;
    gap: 12px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.daily-recharge-summary {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.daily-recharge-summary > div {
    min-width: 0;
    min-height: 78px;
    display: grid;
    align-content: center;
    gap: 4px;
    padding: 12px 14px;
    border-right: 1px solid var(--border);
}

.daily-recharge-summary > div:last-child {
    border-right: 0;
}

.daily-recharge-summary span {
    color: var(--text-muted);
    font-size: 11px;
}

.daily-recharge-summary strong {
    color: var(--text);
    font-size: 21px;
    line-height: 1.15;
}

.daily-recharge-table {
    min-width: 1160px;
}

.daily-recharge-table th,
.daily-recharge-table td {
    min-width: 125px;
    padding: 10px 12px;
    vertical-align: middle;
}

.daily-recharge-table th:nth-child(2),
.daily-recharge-table td:nth-child(2) {
    min-width: 190px;
}

.daily-recharge-table th:nth-child(3),
.daily-recharge-table td:nth-child(3) {
    min-width: 145px;
}

.daily-recharge-package-cell {
    min-width: 180px !important;
    max-width: 260px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.daily-recharge-identity,
.daily-recharge-package,
.daily-recharge-time-pair {
    display: grid;
    gap: 3px;
}

.daily-recharge-identity span,
.daily-recharge-package span,
.daily-recharge-time-pair span {
    color: var(--text-muted);
    font-size: 10px;
}

.followup-identity,
.followup-package {
    display: grid;
    gap: 3px;
}

.followup-identity span,
.followup-package span,
.muted-text {
    color: var(--text-muted);
    font-size: 10px;
}

.followup-workflow-cell {
    vertical-align: middle;
}

.followup-due,
.followup-scheduled {
    display: block;
    margin-top: 5px;
    font-size: 10px;
    line-height: 1.35;
    white-space: nowrap;
}

.followup-due {
    color: var(--red);
    font-weight: 700;
}

.followup-scheduled {
    color: var(--text-muted);
}

.followup-status-time {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.35;
    white-space: nowrap;
}

.phone-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--blue);
    font-weight: 650;
    text-decoration: none;
}

.phone-link:hover {
    text-decoration: underline;
}

.phone-link svg {
    width: 13px;
    height: 13px;
}

.table-button.primary {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: #bcd9d0;
}

.followup-contact-target {
    display: grid;
    gap: 3px;
    padding: 12px;
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.followup-contact-target > span,
.followup-contact-target small {
    color: var(--text-muted);
    font-size: 11px;
}

.followup-contact-target strong {
    font-size: 17px;
}

.filter-bar label {
    display: grid;
    gap: 5px;
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 650;
}

.filter-bar input,
.filter-bar select {
    width: 100%;
    height: 38px;
    padding: 0 10px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    outline: none;
}

.locked-state {
    padding: 6px 9px;
    color: var(--amber);
    background: var(--amber-soft);
}

.phase-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    margin-bottom: 14px;
    border-color: #ebd29e;
    background: #fffaf0;
}

.phase-notice > svg {
    flex: 0 0 auto;
    margin-top: 1px;
    color: var(--amber);
}

.phase-notice strong {
    font-size: 13px;
}

.phase-notice p {
    margin-top: 3px;
    color: var(--text-soft);
    font-size: 12px;
}

.operation-list {
    overflow: hidden;
}

.operation-row {
    min-height: 75px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
}

.operation-row:last-child {
    border-bottom: 0;
}

.operation-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    color: var(--text-soft);
    background: var(--surface-muted);
    border-radius: 7px;
}

.operation-icon svg {
    width: 17px;
    height: 17px;
}

.operation-row strong {
    font-size: 13px;
}

.operation-row p {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 12px;
}

.status-chip {
    padding: 4px 7px;
}

.status-chip.locked {
    color: var(--text-muted);
    background: var(--surface-muted);
}

.modal {
    width: min(calc(100% - 30px), 480px);
    max-height: calc(100vh - 32px);
    padding: 0;
    overflow: visible;
    color: var(--text);
    background: transparent;
    border: 0;
}

.modal::backdrop {
    background: rgba(10, 21, 17, 0.55);
    backdrop-filter: blur(2px);
}

.modal-card {
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.compact-modal {
    width: 100%;
}

.modal-header {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border);
}

.modal-header > div {
    min-width: 0;
    flex: 1;
}

.modal-header h2 {
    font-size: 17px;
}

.modal-header p {
    margin-top: 4px;
    color: var(--text-soft);
    font-size: 12px;
}

.modal-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 7px;
}

.modal-icon.warning {
    color: var(--amber);
    background: var(--amber-soft);
}

.modal-icon.success {
    color: var(--green);
    background: var(--green-soft);
}

.modal-close {
    position: absolute;
    top: 11px;
    right: 11px;
}

.modal-body {
    padding: 18px 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px 20px;
}

.password-actions {
    padding-top: 4px;
}

.permission-list {
    display: grid;
    gap: 8px;
}

.permission-option {
    min-height: 62px;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 11px 12px;
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.permission-option:has(input:checked) {
    background: var(--primary-soft);
    border-color: #aacfc4;
}

.permission-option input {
    width: 16px;
    height: 16px;
    margin: 3px 0 0;
    accent-color: var(--primary);
}

.permission-option span {
    display: grid;
    gap: 2px;
}

.permission-option strong {
    font-size: 13px;
}

.permission-option small {
    color: var(--text-muted);
    font-size: 11px;
}

.permission-session-note {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-top: 12px;
    color: var(--amber);
    font-size: 11px;
}

.permission-session-note svg {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    margin-top: 1px;
}

.operation-target {
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.operation-target span {
    color: var(--text-muted);
    font-size: 11px;
}

.operation-target strong {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.switch-field {
    min-height: 54px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.switch-field > input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch-control {
    position: relative;
    width: 36px;
    height: 20px;
    background: #aebbb7;
    border-radius: 10px;
    transition: background 0.15s;
}

.switch-control::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    transition: transform 0.15s;
}

.switch-field > input:checked + .switch-control {
    background: var(--primary);
}

.switch-field > input:checked + .switch-control::after {
    transform: translateX(16px);
}

.switch-field > input:focus-visible + .switch-control {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.switch-field > span:last-child {
    display: grid;
    gap: 1px;
}

.switch-field strong {
    font-size: 12px;
}

.switch-field small {
    color: var(--text-muted);
    font-size: 11px;
}

.operation-confirm-modal {
    width: min(calc(100% - 30px), 560px);
}

.operation-preview {
    display: grid;
    padding: 0;
    margin: 0;
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.operation-preview > div {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(100px, 0.65fr) minmax(150px, 1.35fr);
    gap: 12px;
    padding: 9px 11px;
    border-bottom: 1px solid var(--border);
}

.operation-preview > div:last-child {
    border-bottom: 0;
}

.operation-preview dt,
.operation-preview dd {
    margin: 0;
    font-size: 12px;
}

.operation-preview dt {
    color: var(--text-muted);
}

.operation-preview dd {
    color: var(--text);
    font-weight: 650;
    overflow-wrap: anywhere;
    text-align: right;
}

.quote-expiry {
    color: var(--amber);
    font-size: 11px;
}

.confirm-check {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    padding: 10px 11px;
    color: var(--text-soft);
    background: var(--amber-soft);
    border: 1px solid #ead29e;
    border-radius: 6px;
    font-size: 12px;
}

.confirm-check input {
    width: 16px;
    height: 16px;
    margin: 1px 0 0;
    accent-color: var(--primary);
}

.confirm-detail {
    margin: 16px 20px 0;
    padding: 10px 12px;
    color: var(--text-soft);
    background: var(--surface-muted);
    border-radius: 6px;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.credential-box {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 4px 12px;
    margin: 18px 20px 4px;
    padding: 13px 12px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.credential-box span {
    color: var(--text-muted);
    font-size: 11px;
}

.credential-box strong {
    grid-column: 1;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 16px;
    overflow-wrap: anywhere;
}

.credential-box .icon-button {
    grid-column: 2;
    grid-row: 1 / span 2;
}

.toast-region {
    position: fixed;
    z-index: 1000;
    right: 18px;
    bottom: 18px;
    width: min(380px, calc(100% - 36px));
    display: grid;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    align-items: start;
    gap: 9px;
    padding: 12px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: 6px;
    box-shadow: var(--shadow);
    pointer-events: auto;
    animation: toast-in 0.2s ease-out;
}

.toast.error { border-left-color: var(--red); }
.toast.warning { border-left-color: var(--amber); }
.toast.success { border-left-color: var(--green); }
.toast.error > svg { color: var(--red); }
.toast.warning > svg { color: var(--amber); }
.toast.success > svg { color: var(--green); }

.toast p {
    padding-top: 1px;
    color: var(--text-soft);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.toast button {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    color: var(--text-muted);
    background: transparent;
    border-radius: 4px;
}

.toast button:hover { background: var(--surface-muted); }
.toast button svg { width: 14px; height: 14px; }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
}

.package-loading {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding-top: 22px;
}

.package-loading span {
    min-height: 245px;
    position: relative;
    overflow: hidden;
    background: #e7ecea;
    border-radius: 8px;
}

.package-loading span::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 35%;
    background: rgba(255, 255, 255, 0.54);
    transform: translateX(-100%);
    animation: shimmer 1.25s infinite;
}

.package-loading.compact-loading {
    padding-top: 0;
    margin-bottom: 12px;
}

.package-loading.compact-loading span {
    min-height: 170px;
}

.package-result {
    padding-top: 22px;
}

.package-result-heading {
    margin-bottom: 14px;
}

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

.package-card {
    min-width: 0;
    min-height: 245px;
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.package-card-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.package-card-heading h3 {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.package-price {
    display: flex;
    align-items: flex-start;
    color: var(--red);
    white-space: nowrap;
}

.package-price span {
    padding-top: 4px;
    font-size: 12px;
    font-weight: 700;
}

.package-price strong {
    font-size: 22px;
    line-height: 1.2;
}

.package-facts {
    display: grid;
    gap: 7px;
    padding: 13px 0;
    margin: 0;
}

.package-facts > div {
    min-width: 0;
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 10px;
}

.package-facts dt,
.package-facts dd {
    font-size: 12px;
}

.package-facts dt {
    color: var(--text-muted);
}

.package-facts dd {
    margin: 0;
    color: var(--text-soft);
    font-weight: 600;
    overflow-wrap: anywhere;
    text-align: right;
}

.package-card-footer {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 12px;
    margin-top: auto;
    border-top: 1px solid var(--border);
}

.package-id {
    min-width: 0;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.package-order-button {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 6px 9px;
    font-size: 11px;
}

.sidebar-backdrop {
    display: none;
}

.mobile-only {
    display: none;
}

@media (max-width: 1180px) {
    .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .package-grid, .package-loading { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .contextual-action-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .result-columns { grid-template-columns: minmax(0, 1.35fr) minmax(270px, 0.8fr); }
}

@media (max-width: 920px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: 12px 0 30px rgba(10, 23, 18, 0.18);
    }

    .workspace.sidebar-visible .sidebar { transform: translateX(0); }
    .workspace.sidebar-visible .sidebar-backdrop { display: block; }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 25; background: rgba(10, 20, 16, 0.48); }
    .sidebar-close { display: grid !important; }
    .workspace-main { margin-left: 0; }
    .mobile-only { display: grid; }
    .query-row { grid-template-columns: minmax(230px, 1fr) auto; }
    .segmented-control { grid-column: 1; grid-row: 2; justify-self: start; }
    .query-submit { grid-column: 2; grid-row: 1; }
    .result-columns { grid-template-columns: 1fr; }
    .contextual-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .filter-submit { grid-column: 3; justify-self: end; }
    .followup-toolbar { grid-template-columns: minmax(180px, 1fr) auto auto; }
    .daily-recharge-toolbar { grid-template-columns: 1fr 1fr; }
    .daily-recharge-toolbar > .button { justify-self: end; }
    .recharge-summary-form { grid-template-columns: 1fr; }
    .recharge-summary-form > .button { justify-self: start; }
    .daily-recharge-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .daily-recharge-summary > div:nth-child(3n) { border-right: 0; }
    .daily-recharge-summary > div:nth-child(-n+3) { border-bottom: 1px solid var(--border); }
    .followup-source-control { grid-column: 1 / -1; }
    .followup-toolbar > .button { justify-self: start; }
}

@media (max-width: 680px) {
    .topbar { min-height: 62px; padding: 10px 14px; }
    .topbar-title p, .environment-badge { display: none; }
    .topbar-title h1 { font-size: 16px; }
    .content { padding: 14px 12px 32px; }
    .query-panel { padding: 12px; }
    .diagnose-mode-switch { width: 100%; }
    .diagnose-mode-switch button { min-width: 0; flex: 1; }
    .query-row { display: flex; flex-direction: column; align-items: stretch; }
    .segmented-control { width: 100%; }
    .segmented-control label { flex: 1; }
    .segmented-control span { justify-content: center; padding: 0 6px; }
    .query-submit { width: 100%; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .device-card-grid { grid-template-columns: 1fr; }
    .result-heading { align-items: flex-start; }
    .result-heading h3 { font-size: 15px; }
    .result-section { padding: 0; }
    .advice-panel { padding: 14px; }
    .detail-grid { grid-template-columns: 1fr; }
    .page-tools { align-items: flex-start; }
    .page-tools > .button { min-width: 38px; }
    .filter-bar { grid-template-columns: 1fr 1fr; padding: 12px; }
    .filter-bar label:first-child { grid-column: 1 / -1; }
    .filter-submit { grid-column: auto; width: 100%; }
    .followup-toolbar { grid-template-columns: 1fr; padding: 12px; }
    .followup-source-control { grid-column: auto; }
    .followup-toolbar > .button { width: 100%; }
    .followup-summary { grid-template-columns: 1fr 1fr; }
    .followup-summary > div:nth-child(2) { border-right: 0; }
    .followup-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
    .inventory-import-form { grid-template-columns: 1fr; }
    .inventory-import-form > .button { width: 100%; }
    .inventory-preview-summary { grid-template-columns: 1fr 1fr; }
    .inventory-preview-summary > div { border-bottom: 1px solid var(--border); }
    .inventory-preview-summary > div:nth-child(2n) { border-right: 0; }
    .inventory-preview-summary > div:nth-last-child(-n+2) { border-bottom: 0; }
    .inventory-preview-actions { align-items: stretch; flex-direction: column-reverse; }
    .inventory-preview-actions .button { width: 100%; }
    .wechat-order-import-form { grid-template-columns: 1fr; }
    .wechat-order-import-form > .button { width: 100%; }
    .wechat-order-preview-summary { grid-template-columns: 1fr 1fr; }
    .wechat-order-preview-summary > div { border-bottom: 1px solid var(--border); }
    .wechat-order-preview-summary > div:nth-child(2n) { border-right: 0; }
    .wechat-order-preview-summary > div:nth-last-child(-n+2) { border-bottom: 0; }
    .wechat-order-preview-actions { align-items: stretch; flex-direction: column-reverse; }
    .wechat-order-preview-actions .button { width: 100%; }
    .daily-recharge-toolbar { grid-template-columns: 1fr; padding: 12px; }
    .daily-recharge-toolbar > .button { width: 100%; }
    .recharge-summary-form { grid-template-columns: 1fr; padding: 12px; }
    .recharge-summary-form > .button { width: 100%; }
    .recharge-summary-preview-heading { align-items: flex-start; }
    .recharge-summary-preview-metrics { grid-template-columns: 1fr 1fr; }
    .recharge-summary-preview-metrics > div { border-bottom: 1px solid var(--border); }
    .recharge-summary-preview-metrics > div:nth-child(2n) { border-right: 0; }
    .recharge-summary-preview-metrics > div:nth-last-child(-n+2) { border-bottom: 0; }
    .recharge-summary-preview-actions { align-items: stretch; flex-direction: column-reverse; }
    .recharge-summary-preview-actions .button { width: 100%; }
    .daily-recharge-summary { grid-template-columns: 1fr 1fr; }
    .daily-recharge-summary > div:nth-child(3n) { border-right: 1px solid var(--border); }
    .daily-recharge-summary > div:nth-child(2n) { border-right: 0; }
    .daily-recharge-summary > div:nth-child(-n+4) { border-bottom: 1px solid var(--border); }
    .daily-recharge-table { min-width: 0; }
    .daily-recharge-table thead { display: none; }
    .daily-recharge-table tbody { display: grid; gap: 8px; }
    .daily-recharge-table tr {
        display: grid;
        padding: 8px 10px;
        border: 1px solid var(--border);
        border-radius: 6px;
    }
    .daily-recharge-table td,
    .daily-recharge-table .daily-recharge-package-cell {
        min-width: 0;
        max-width: none;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding: 7px 0;
        border-bottom: 1px solid var(--border);
        white-space: normal;
        text-align: right;
        overflow-wrap: anywhere;
    }
    .daily-recharge-table td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        color: var(--text-muted);
        font-size: 11px;
        font-weight: 600;
    }
    .daily-recharge-table td:last-child { border-bottom: 0; }
    .daily-recharge-identity,
    .daily-recharge-package,
    .daily-recharge-time-pair { justify-items: end; }
    .operation-row { grid-template-columns: 36px minmax(0, 1fr); }
    .operation-row .status-chip { grid-column: 2; justify-self: start; }
    .operation-heading, .subsection-heading { align-items: flex-start; }
    .contextual-action-grid { grid-template-columns: 1fr; }
    .contextual-action-card { min-height: 118px; }
    .receipt-row { grid-template-columns: 30px minmax(0, 1fr); }
    .receipt-row time { grid-column: 2; }
    .package-grid, .package-loading { grid-template-columns: 1fr; }
    .package-card { min-height: 220px; }
    .auth-layout { padding: 14px; }
    .auth-panel { padding: 22px 18px; }
    .modal { width: min(calc(100% - 20px), 480px); }
    .modal-header { padding: 17px 16px 14px; }
    .modal-body { padding: 16px; }
    .modal-actions { padding: 12px 16px 16px; }
    .operation-preview > div { grid-template-columns: minmax(82px, 0.6fr) minmax(120px, 1.4fr); }
}

@media (max-width: 420px) {
    .auth-shortcuts { grid-template-columns: 1fr; }
    .metric-grid { grid-template-columns: 1fr; }
    .metric-card { min-height: 72px; }
    .device-card-heading { align-items: flex-start; }
    .filter-bar { grid-template-columns: 1fr; }
    .filter-bar label:first-child { grid-column: auto; }
    .result-heading { display: grid; }
    .health-badge { justify-self: start; }
    .package-result-heading .locked-state { justify-self: start; }
    .package-card-heading { grid-template-columns: 1fr; }
    .package-price { justify-self: start; }
    .package-card-footer { align-items: stretch; flex-direction: column; }
    .package-order-button { width: 100%; }
    .modal-actions .button { flex: 1; }
    .secure-action-badge { align-self: flex-start; }
    .operation-heading { display: grid; }
    .operation-preview > div { grid-template-columns: 1fr; gap: 3px; }
    .operation-preview dd { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
