:root {
    /* 消防主题色 - 优化后更现代 */
    --fire-red: #E53935;       /* 消防红 - 更鲜艳 */
    --fire-blue: #1565C0;      /* 消防蓝 - 更明亮 */
    --fire-blue-light: #42A5F5;/* 浅蓝 - 渐变用 */
    --fire-yellow: #FFB300;    /* 警示黄 - 辅助 */
    --text-dark: #1A1A2E;      /* 正文黑 - 更深 */
    --text-grey: #6B7280;      /* 辅助灰 */
    --bg-light: #F0F4F8;       /* 背景色 - 更柔和 */
    --card-bg: #FFFFFF;        /* 卡片背景 */
    --border-color: #E5E7EB;   /* 边框色 */
    --success-green: #10B981;  /* 成功绿 */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

    /* 尺寸变量 */
    --header-height: 56px;
    --border-radius: 12px;     /* 更圆润 */
    --border-radius-sm: 8px;
    --touch-target: 48px;      /* 最小点击区域 */
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --brand-deep: #0F4699;
    --brand-mid: #1F66D8;
    --panel-shadow: 0 16px 45px rgba(31, 102, 216, 0.10);
}

/* 基础重置与排版 */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background:
        radial-gradient(circle at 12% 8%, rgba(31, 102, 216, 0.10), transparent 28%),
        linear-gradient(180deg, #EEF5FF 0%, #F7FAFF 42%, #FFFFFF 100%);
    color: var(--text-dark);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 16px;
    min-height: 100vh;
    padding-bottom: var(--safe-area-bottom);
}

/* 媒体查询：字体大小适配 */
@media (max-width: 768px) {
    body { font-size: 15px; }
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.15rem; }
    h5 { font-size: 1.05rem; }

    .app-shell {
        width: 100%;
        margin: 0;
        min-height: 100vh;
        border-radius: 0;
        border: 0;
    }

    .app-topbar {
        min-height: 88px;
        padding: 18px;
        align-items: flex-start;
    }

    .brand-lockup strong {
        font-size: 1.05rem;
    }

    .brand-lockup small {
        font-size: 0.82rem;
    }

    .brand-emblem {
        width: 44px;
        height: 44px;
        font-size: 1.35rem;
    }

    .topbar-actions {
        gap: 8px;
    }

    .topbar-icon {
        display: none;
    }

    .user-chip {
        font-size: 0;
    }

    .user-chip i {
        font-size: 1.35rem;
    }

    .logout-link {
        font-size: 0.86rem;
    }

    .app-body {
        display: block;
    }

    .app-sidebar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1040;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 2px;
        padding: 8px 8px calc(8px + var(--safe-area-bottom));
        border-top: 1px solid #DFE9F7;
        border-right: 0;
        background: rgba(255,255,255,0.96);
        box-shadow: 0 -12px 30px rgba(15, 70, 153, 0.10);
    }

    .side-link {
        min-height: 48px;
        flex-direction: column;
        justify-content: center;
        gap: 3px;
        margin: 0;
        padding: 4px;
        font-size: 0.75rem;
    }

    .side-link i {
        width: auto;
    }

    .sidebar-motto {
        display: none;
    }

    .app-main {
        padding: 16px 14px calc(86px + var(--safe-area-bottom));
    }

    .dashboard-hero {
        padding: 22px;
    }

    .metric-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .analytics-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .analytics-card {
        padding: 16px;
    }

    .chart-box {
        height: 260px;
    }

    .metric-card {
        min-height: 102px;
        padding: 15px;
    }

    .metric-card .metric-value {
        font-size: 1.08rem;
        word-break: break-word;
    }

    .toolbar-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-shortcut-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .shortcut-card {
        padding: 14px;
        grid-template-columns: 40px minmax(0, 1fr) auto;
    }

    .shortcut-icon {
        width: 40px;
        height: 40px;
    }

    .invoice-query-hero,
    .invoice-query-grid,
    .invoice-query-bottom-grid,
    .invoice-item-grid,
    .invoice-task-meta {
        grid-template-columns: 1fr;
    }

    .invoice-query-status {
        min-width: 0;
    }

    .invoice-form-actions,
    .invoice-item-head,
    .invoice-history-item,
    .invoice-batch-footer,
    .invoice-scan-result-item,
    .invoice-scan-result-head {
        flex-direction: column;
        align-items: stretch;
    }

    .invoice-history-item {
        gap: 8px;
    }

    .invoice-batch-summary {
        gap: 6px 12px;
    }

    .salary-record-summary {
        align-items: stretch;
        flex-direction: column;
    }

    .salary-record-amounts {
        width: 100%;
        justify-content: space-between;
        gap: 10px;
    }

    .salary-record-amounts .text-end {
        text-align: left !important;
    }

    .salary-record-head {
        padding: 15px;
    }

    .salary-record-body {
        padding: 12px;
    }

    .detail-line {
        align-items: flex-start;
    }

    .detail-line span,
    .detail-line strong {
        min-width: 0;
        overflow-wrap: anywhere;
    }
}

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

    .app-topbar {
        min-height: auto;
        gap: 10px;
    }

    .dashboard-hero h2 {
        font-size: 1.22rem;
    }

    .chart-box {
        height: 230px;
    }
}

.stats-metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.site-stats-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 14px;
}

.stats-panel {
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid #E6EEF9;
    border-radius: 10px;
    box-shadow: 0 10px 26px rgba(15, 70, 153, 0.08);
}

.stats-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #E6EEF9;
}

.stats-panel-head h3 {
    margin: 0;
    color: #172033;
    font-size: 1rem;
    font-weight: 900;
}

.stats-panel-head span {
    color: #64748B;
    font-size: 0.86rem;
    font-weight: 800;
    white-space: nowrap;
}

.stats-panel .table {
    font-size: 0.9rem;
}

.stats-panel .table th {
    color: #64748B;
    font-size: 0.78rem;
    font-weight: 900;
    background: #F8FAFC;
    white-space: nowrap;
}

.stats-path {
    max-width: 360px;
    color: #64748B;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.82rem;
    overflow-wrap: anywhere;
}

.login-source-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 2px 6px 2px 0;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 900;
    white-space: nowrap;
}

.login-source-badge.web {
    color: #0F4699;
    background: #EAF2FF;
}

.login-source-badge.app {
    color: #047857;
    background: #E8F8EF;
}

@media (max-width: 768px) {
    .stats-metric-grid,
    .site-stats-layout {
        grid-template-columns: 1fr;
    }

    .stats-panel-head {
        align-items: flex-start;
        flex-direction: column;
    }
}

.admin-menu-head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
    padding: 18px;
    background: #fff;
    border: 1px solid #E6EEF9;
    border-radius: 10px;
    box-shadow: 0 10px 26px rgba(15, 70, 153, 0.08);
}

.admin-menu-head h2 {
    margin: 2px 0 6px;
    color: #172033;
    font-size: 1.45rem;
    font-weight: 900;
}

.admin-menu-head p {
    margin: 0;
    color: #64748B;
}

.admin-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.admin-featured-card {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding: 18px 20px;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(135deg, #0F4699, #1F66D8);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 10px;
    box-shadow: 0 16px 38px rgba(15, 70, 153, 0.20);
}

.admin-featured-card:hover {
    color: #fff;
    transform: translateY(-1px);
}

.admin-featured-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    color: #0F4699;
    font-size: 1.45rem;
    background: rgba(255,255,255,0.95);
    border-radius: 10px;
}

.admin-featured-copy strong,
.admin-featured-copy small {
    display: block;
}

.admin-featured-copy strong {
    font-size: 1.08rem;
    font-weight: 900;
}

.admin-featured-copy small {
    margin-top: 4px;
    color: rgba(255,255,255,0.90);
    line-height: 1.5;
}

.admin-featured-cta {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: #0F4699;
    background: rgba(255,255,255,0.96);
    border-radius: 999px;
}

.admin-menu-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 18px;
    color: #172033;
    text-decoration: none;
    background: #fff;
    border: 1px solid #E6EEF9;
    border-radius: 10px;
    box-shadow: 0 10px 26px rgba(15, 70, 153, 0.08);
}

.admin-menu-card:hover {
    color: #0F4699;
    border-color: #BFD5F6;
}

.admin-menu-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 1.35rem;
    background: linear-gradient(135deg, #0F4699, #1F66D8);
    border-radius: 10px;
}

.admin-menu-card strong,
.admin-menu-card small {
    display: block;
}

.admin-menu-card strong {
    font-size: 1rem;
    font-weight: 900;
}

.admin-menu-card small {
    margin-top: 3px;
    color: #64748B;
    line-height: 1.45;
}

.admin-menu-card.danger .admin-menu-icon {
    background: linear-gradient(135deg, #B91C1C, #EF4444);
}

.invoice-query-shell {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

body.invoice-query-page main.container {
    width: min(100%, 1600px);
    max-width: 1600px;
    padding-left: min(2vw, 24px);
    padding-right: min(2vw, 24px);
}

.invoice-query-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: stretch;
}

.invoice-query-status {
    min-width: 220px;
    padding: 16px 18px;
    border: 1px solid rgba(31, 102, 216, 0.16);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: center;
}

.invoice-query-status strong {
    font-size: 1.02rem;
}

.invoice-query-status small {
    color: var(--text-grey);
}

.invoice-hero-copy {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.invoice-hero-copy h2 {
    margin: 0;
}

.invoice-hero-copy p {
    margin: 0;
    max-width: 70ch;
}

.invoice-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.invoice-hero-tags span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(31, 102, 216, 0.08);
    color: #184c9b;
    font-size: 0.88rem;
    white-space: nowrap;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #94a3b8;
    box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.18);
}

.status-dot.ok {
    background: var(--success-green);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
}

.status-dot.bad {
    background: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.18);
}

.invoice-query-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 18px;
}

.invoice-query-bottom-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
}

.invoice-query-panel {
    overflow: hidden;
}

.invoice-query-panel .card-header {
    background: rgba(31, 102, 216, 0.03);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.invoice-upload-zone {
    border: 2px dashed #9EB4D8;
    border-radius: 18px;
    min-height: 340px;
    padding: 54px 28px;
    background:
        linear-gradient(180deg, rgba(246, 250, 255, 0.92), rgba(255, 255, 255, 0.98)),
        repeating-linear-gradient(0deg, transparent 0 31px, rgba(148, 163, 184, 0.12) 32px),
        repeating-linear-gradient(90deg, transparent 0 31px, rgba(148, 163, 184, 0.12) 32px);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.invoice-upload-zone.has-files {
    justify-content: flex-start;
}

.invoice-upload-zone:hover,
.invoice-upload-zone.dragging {
    border-color: #5B8DEF;
    box-shadow: inset 0 0 0 1px rgba(31, 102, 216, 0.12), 0 18px 36px rgba(31, 102, 216, 0.12);
    transform: translateY(-1px);
}

.invoice-upload-zone i {
    font-size: 4rem;
    color: var(--brand-mid);
}

.invoice-upload-zone strong {
    font-size: 1.2rem;
}

.invoice-upload-zone span {
    color: var(--text-grey);
    font-size: 0.92rem;
}

.invoice-zone-meta {
    color: #475569;
    font-size: 0.86rem;
    line-height: 1.4;
}

.invoice-upload-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 14px;
}

@media (max-width: 576px) {
    .invoice-upload-actions {
        justify-content: stretch;
    }

    .invoice-upload-actions .btn {
        flex: 1 1 100%;
        min-height: 44px;
    }
}

.invoice-scan-zone {
    border: 1.5px dashed #B7C7E6;
    border-radius: 16px;
    padding: 24px 18px;
    background: linear-gradient(180deg, rgba(244, 248, 255, 0.9), rgba(255, 255, 255, 0.98));
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.invoice-scan-zone:hover,
.invoice-scan-zone.dragging {
    border-color: #5B8DEF;
    box-shadow: 0 10px 24px rgba(31, 102, 216, 0.08);
    transform: translateY(-1px);
}

.invoice-scan-zone i {
    font-size: 1.9rem;
    color: var(--brand-mid);
}

.invoice-scan-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.invoice-file-list {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 18px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px dashed rgba(148, 163, 184, 0.5);
}

.invoice-file-item {
    --upload-percent: 0%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    min-width: 0;
    padding: 14px 10px 12px;
    border-radius: 12px;
    background: #F8FAFC;
    border: 1px solid #D9E2F0;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.invoice-file-icon {
    position: relative;
    width: 72px;
    height: 84px;
    overflow: hidden;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    background: linear-gradient(180deg, #F1F5F9 0%, #E2E8F0 100%);
    display: grid;
    place-items: center;
    color: #64748B;
}

.invoice-file-icon[data-file-type="pdf"] {
    color: #B91C1C;
}

.invoice-file-icon[data-file-type="image"] {
    color: #1F66D8;
}

.invoice-file-icon::before {
    content: "";
    position: absolute;
    top: -1px;
    right: -1px;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #FFFFFF 0 49%, #CBD5E1 50% 100%);
    border-left: 1px solid #CBD5E1;
    border-bottom: 1px solid #CBD5E1;
}

.invoice-file-icon-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--upload-percent);
    background: linear-gradient(180deg, #5B8DEF 0%, #1F66D8 58%, #16A34A 100%);
    opacity: 0.94;
    transition: height .18s ease;
}

.invoice-file-icon[data-file-type="pdf"] .invoice-file-icon-fill {
    background: linear-gradient(180deg, #F87171 0%, #DC2626 58%, #16A34A 100%);
}

.invoice-file-icon[data-file-type="image"] .invoice-file-icon-fill {
    background: linear-gradient(180deg, #60A5FA 0%, #2563EB 58%, #16A34A 100%);
}

.invoice-file-icon i,
.invoice-file-icon span {
    position: relative;
    z-index: 1;
}

.invoice-file-icon i {
    font-size: 2rem;
}

.invoice-file-icon span {
    align-self: end;
    margin-bottom: 10px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    color: #334155;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.4;
}

.invoice-file-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #0F172A;
    font-size: 0.88rem;
}

.invoice-file-item small {
    color: var(--text-grey);
    font-size: 0.78rem;
}

.invoice-file-progress {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
    align-items: center;
}

.invoice-file-progress-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #E2E8F0;
}

.invoice-file-progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #1F66D8, #22C55E);
    transition: width .18s ease;
}

.invoice-file-progress-text {
    min-width: 0;
    color: #475569;
    font-size: 0.76rem;
    text-align: center;
    white-space: nowrap;
}

.invoice-file-item[data-status="failed"] .invoice-file-progress-bar {
    background: #ef4444;
}

.invoice-file-item[data-status="failed"] .invoice-file-icon-fill {
    background: #ef4444;
}

.invoice-file-item[data-status="done"] .invoice-file-progress-bar {
    background: #16a34a;
}

.invoice-file-item[data-status="done"] .invoice-file-icon-fill {
    background: #16a34a;
}

.invoice-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 18px;
    flex-wrap: wrap;
}

.invoice-batch-table-wrap {
    margin-top: 16px;
    overflow-x: auto;
}

.invoice-batch-table {
    margin-bottom: 0;
    background: #fff;
    min-width: 760px;
}

.invoice-batch-table thead th {
    font-size: 0.88rem;
    color: #334155;
    background: #F7FAFF;
    white-space: nowrap;
}

.invoice-batch-table td,
.invoice-batch-table th {
    vertical-align: middle;
}

.invoice-inline-input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    font-size: 0.92rem;
}

.invoice-inline-input:focus {
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.12);
}

.invoice-batch-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-top: 14px;
    border-top: 1px solid #E2E8F0;
    margin-top: 8px;
}

.invoice-batch-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    color: #334155;
}

.invoice-batch-summary strong {
    color: #0f172a;
    font-size: 1rem;
}

.invoice-scan-result {
    margin-top: 12px;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    padding: 12px 14px;
    background: #FBFDFF;
}

.invoice-scan-result-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
}

.invoice-scan-result-list {
    display: grid;
    gap: 8px;
}

.invoice-scan-result-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 12px;
    background: #F8FAFF;
    border: 1px solid #E2E8F0;
}

.invoice-progress-box {
    padding: 16px;
    border-radius: 14px;
    border: 1px solid #E2E8F0;
    background: #FBFDFF;
    margin-bottom: 16px;
}

.invoice-progress-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.invoice-progress-title strong {
    font-size: 1rem;
}

.invoice-progress-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.invoice-progress-stats > div,
.invoice-item-grid > div {
    padding: 10px 12px;
    border-radius: 12px;
    background: #F8FAFF;
    border: 1px solid #E2E8F0;
}

.invoice-progress-stats span,
.invoice-item-grid span {
    display: block;
    font-size: 0.78rem;
    color: var(--text-grey);
}

.invoice-progress-stats strong,
.invoice-item-grid strong {
    display: block;
    margin-top: 2px;
    word-break: break-word;
}

.invoice-summary-text {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(21, 101, 192, 0.06);
    border: 1px solid rgba(21, 101, 192, 0.14);
    margin-bottom: 16px;
    color: #18314f;
}

.invoice-item-list,
.invoice-history-list {
    display: grid;
    gap: 14px;
}

.invoice-item-list {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    align-items: stretch;
    width: 100%;
    grid-auto-flow: row dense;
}

.invoice-item-card {
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 14px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.invoice-item-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

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

.invoice-item-actions {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
}

#resultItems.invoice-item-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
    gap: 14px !important;
    align-items: stretch !important;
}

.invoice-item-card[data-state="running"] {
    border-color: rgba(31, 102, 216, 0.35);
    box-shadow: 0 10px 28px rgba(31, 102, 216, 0.08);
}

.invoice-item-progress {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #F8FAFF;
    border: 1px solid #E2E8F0;
    color: #334155;
    font-size: 0.9rem;
    line-height: 1.45;
}

.invoice-item-meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.invoice-item-meta-line span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(31, 102, 216, 0.08);
    color: #184c9b;
    font-size: 0.78rem;
}

@media (max-width: 991.98px) {
    .invoice-progress-stats,
    .invoice-item-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.invoice-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
    border: 1px solid #E2E8F0;
    background: #fff;
    border-radius: 14px;
    padding: 12px 14px;
    text-align: left;
    box-shadow: var(--shadow-sm);
}

.invoice-history-item strong,
.invoice-history-item small {
    display: block;
}

.invoice-history-item strong {
    font-size: 0.96rem;
}

.invoice-history-item small {
    color: var(--text-grey);
}

body.invoice-query-page .app-main {
    background:
        radial-gradient(circle at top right, rgba(31, 102, 216, 0.12), transparent 24%),
        linear-gradient(180deg, #F8FBFF 0%, #FFFFFF 45%, #FFFFFF 100%);
}

.admin-overview-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
    gap: 16px;
    align-items: start;
}

.admin-overview-panel {
    padding: 18px;
}

.admin-action-grid {
    display: grid;
    gap: 12px;
}

.admin-action-card {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    color: #172033;
    text-decoration: none;
    background: #F8FBFF;
    border: 1px solid #E6EEF9;
    border-radius: 8px;
}

.admin-action-card:hover {
    color: #0F4699;
    background: #fff;
    border-color: #BFD5F6;
}

.admin-action-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 1.25rem;
    background: linear-gradient(135deg, #0F4699, #1F66D8);
    border-radius: 8px;
}

.admin-action-icon.green {
    background: linear-gradient(135deg, #138A4E, #22C55E);
}

.admin-action-icon.orange {
    background: linear-gradient(135deg, #D97706, #F59E0B);
}

.admin-action-card strong,
.admin-action-card small {
    display: block;
}

.admin-action-card strong {
    font-size: 1rem;
    font-weight: 900;
}

.admin-action-card small {
    margin-top: 3px;
    color: #64748B;
    line-height: 1.45;
}

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

.admin-summary-list > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #EEF2F7;
}

.admin-summary-list > div:last-child {
    border-bottom: 0;
}

.admin-summary-list span {
    color: #64748B;
}

.admin-summary-list strong {
    color: #172033;
    text-align: right;
}

.ai-chat-layout,
.ai-admin-layout {
    display: grid;
    grid-template-columns: minmax(220px, 0.35fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.ai-role-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.ai-role-select-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 18px;
    color: #172033;
    text-decoration: none;
    background: #fff;
    border: 1px solid #E6EEF9;
    border-radius: 10px;
    box-shadow: 0 10px 26px rgba(15, 70, 153, 0.08);
}

.ai-role-select-card.disabled {
    opacity: 0.55;
    pointer-events: none;
}

.ai-role-select-card strong,
.ai-role-select-card small {
    display: block;
}

.ai-role-select-card small {
    margin-top: 3px;
    color: #64748B;
    line-height: 1.45;
}

.ai-role-select-unavailable {
    min-height: 220px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    color: #64748B;
    text-align: center;
}

.ai-immersive-shell {
    min-height: calc(100dvh - 160px);
}

.ai-back-link {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 4px;
    color: #1F66D8;
    font-size: 0.82rem;
    font-weight: 800;
    text-decoration: none;
}

.ai-role-panel,
.ai-chat-panel,
.ai-admin-panel {
    padding: 16px;
}

.ai-role-list,
.ai-admin-role-grid,
.ai-user-list {
    display: grid;
    gap: 10px;
}

.ai-role-item,
.ai-admin-role-card,
.ai-user-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 12px;
    color: #172033;
    text-decoration: none;
    background: #F8FBFF;
    border: 1px solid #E6EEF9;
    border-radius: 8px;
}

.ai-admin-role-card {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    width: 100%;
    text-align: left;
}

.ai-role-item.active,
.ai-user-row.active {
    color: #0F4699;
    border-color: #AFCBF5;
    background: #EFF6FF;
}

.ai-role-item.disabled {
    opacity: 0.58;
}

.ai-role-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 1.18rem;
    background: linear-gradient(135deg, #0F4699, #1F66D8);
    border-radius: 8px;
}

.ai-role-item strong,
.ai-role-item small,
.ai-admin-role-card strong,
.ai-admin-role-card small,
.ai-user-row strong,
.ai-user-row small {
    display: block;
}

.ai-role-item small,
.ai-admin-role-card small,
.ai-user-row small {
    margin-top: 3px;
    color: #64748B;
    line-height: 1.4;
}

.ai-user-row {
    grid-template-columns: minmax(0, 1fr) auto;
}

.ai-user-row em {
    color: #64748B;
    font-style: normal;
    font-size: 0.8rem;
}

.ai-chat-head,
.ai-record-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.ai-chat-head h3,
.ai-record-head h4 {
    margin: 0 0 4px;
    color: #172033;
    font-weight: 900;
}

.ai-chat-head span,
.ai-record-head span {
    color: #64748B;
}

.ai-message-list {
    height: min(58vh, 560px);
    min-height: 360px;
    overflow-y: auto;
    padding: 14px;
    background: #F8FBFF;
    border: 1px solid #E6EEF9;
    border-radius: 8px;
}

.ai-message {
    display: flex;
    margin-bottom: 12px;
}

.ai-message.user {
    justify-content: flex-end;
}

.ai-message-bubble {
    max-width: min(78%, 680px);
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #E6EEF9;
    border-radius: 8px;
}

.ai-message.user .ai-message-bubble {
    color: #fff;
    background: #1F66D8;
    border-color: #1F66D8;
}

.ai-message-bubble span {
    display: block;
    margin-bottom: 4px;
    font-size: 0.78rem;
    font-weight: 800;
    opacity: 0.78;
}

.ai-message-bubble p,
.ai-message-bubble .ai-plain {
    margin: 0;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.ai-message.assistant .ai-message-bubble {
    font-size: 0.9rem;
}

.ai-message.assistant .ai-message-bubble p,
.ai-message.assistant .ai-markdown,
.ai-message.assistant .ai-plain,
.ai-message.assistant .ai-markdown p,
.ai-message.assistant .ai-markdown li,
.ai-message.assistant .ai-markdown blockquote,
.ai-message.assistant .ai-markdown pre,
.ai-message.assistant .ai-markdown code {
    font-size: 0.9rem;
    line-height: 1.45;
}

.ai-message.assistant .ai-markdown h1,
.ai-message.assistant .ai-markdown h2,
.ai-message.assistant .ai-markdown h3,
.ai-message.assistant .ai-markdown h4,
.ai-message.assistant .ai-markdown h5,
.ai-message.assistant .ai-markdown h6 {
    margin: 0 0 0.45em;
    line-height: 1.25;
}

.ai-message.assistant .ai-markdown p {
    margin: 0 0 0.55em;
}

.ai-message.assistant .ai-plain {
    white-space: pre-wrap;
}

.ai-message.assistant .ai-markdown p:last-child,
.ai-message.assistant .ai-plain:last-child,
.ai-message.assistant .ai-markdown ul:last-child,
.ai-message.assistant .ai-markdown ol:last-child,
.ai-message.assistant .ai-markdown blockquote:last-child,
.ai-message.assistant .ai-markdown pre:last-child,
.ai-message.assistant .ai-markdown table:last-child {
    margin-bottom: 0;
}

.ai-message.assistant .ai-markdown ul,
.ai-message.assistant .ai-markdown ol {
    margin: 0 0 0.6em 1.2em;
    padding-left: 1.1em;
}

.ai-message.assistant .ai-markdown blockquote {
    margin: 0 0 0.6em;
    padding-left: 0.7em;
    color: #475569;
    border-left: 3px solid #D8E4F7;
}

.ai-message.assistant .ai-markdown pre {
    margin: 0 0 0.6em;
    padding: 10px 12px;
    overflow: auto;
    white-space: pre-wrap;
    background: #F8FBFF;
    border: 1px solid #E6EEF9;
    border-radius: 8px;
}

.ai-message.assistant .ai-markdown code {
    padding: 0.1em 0.3em;
    background: #EEF4FF;
    border-radius: 4px;
}

.ai-message.assistant .ai-markdown a {
    color: #1F66D8;
    text-decoration: underline;
}

.ai-message.assistant .ai-markdown hr {
    margin: 0.75em 0;
    border: 0;
    border-top: 1px solid #D8E4F7;
}

.ai-message.assistant .ai-markdown del {
    color: #64748B;
}

.ai-message.assistant .ai-task-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ai-message.assistant .ai-task-item input {
    width: 14px;
    height: 14px;
    accent-color: #1F66D8;
}

.ai-message.assistant .ai-markdown-image {
    max-width: 100%;
    max-height: 360px;
    display: block;
    margin: 8px 0;
    object-fit: contain;
    background: #F8FBFF;
    border: 1px solid #E6EEF9;
    border-radius: 8px;
}

.ai-message.assistant .ai-markdown-table-wrap {
    width: 100%;
    overflow-x: auto;
    margin: 0 0 0.7em;
    border: 1px solid #D9E5F6;
    border-radius: 8px;
    background: #fff;
    -webkit-overflow-scrolling: touch;
}

.ai-message.assistant .ai-markdown-table {
    width: max-content;
    min-width: 100%;
    margin: 0;
    border-collapse: collapse;
    table-layout: auto;
    display: table;
    white-space: nowrap;
}

.ai-message.assistant .ai-markdown-table .text-center {
    text-align: center;
}

.ai-message.assistant .ai-markdown-table .text-right {
    text-align: right;
}

.ai-message.assistant .ai-markdown-table th,
.ai-message.assistant .ai-markdown-table td {
    padding: 8px 10px;
    border-right: 1px solid #E6EEF9;
    border-bottom: 1px solid #E6EEF9;
    vertical-align: top;
    word-break: keep-all;
    white-space: nowrap;
}

.ai-message.assistant .ai-markdown-table th {
    background: #F6FAFF;
    color: #172033;
    font-weight: 800;
}

.ai-message.assistant .ai-markdown-table tr:last-child td {
    border-bottom: 0;
}

.ai-message.assistant .ai-markdown-table th:last-child,
.ai-message.assistant .ai-markdown-table td:last-child {
    border-right: 0;
}

.ai-chat-form {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.ai-chat-form textarea {
    resize: vertical;
}

.ai-input-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: stretch;
}

.ai-input-row .btn {
    min-width: 46px;
}

.ai-attach-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ai-attach-preview span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    padding: 4px 8px;
    color: #334155;
    font-size: 0.78rem;
    background: #EEF6FF;
    border: 1px solid #D6E8FF;
    border-radius: 999px;
}

.ai-generated-image {
    display: block;
    max-width: min(320px, 100%);
    max-height: 360px;
    object-fit: contain;
    border-radius: 8px;
}

.ai-unavailable,
.ai-empty-chat {
    min-height: 220px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    color: #64748B;
    text-align: center;
}

.ai-unavailable i,
.ai-empty-chat i {
    color: #1F66D8;
    font-size: 2.1rem;
}

.ai-unavailable strong,
.ai-empty-chat strong {
    color: #172033;
    font-size: 1.05rem;
}

.ai-record-layout {
    display: grid;
    grid-template-columns: minmax(220px, 0.32fr) minmax(0, 1fr);
    gap: 14px;
    margin-top: 14px;
}

.ai-admin-message-list {
    max-height: 560px;
    overflow-y: auto;
    display: grid;
    gap: 10px;
}

.ai-admin-message {
    padding: 12px;
    background: #F8FBFF;
    border: 1px solid #E6EEF9;
    border-radius: 8px;
}

.ai-admin-message strong,
.ai-admin-message span {
    display: block;
}

.ai-admin-message span {
    margin-top: 2px;
    color: #64748B;
    font-size: 0.82rem;
}

.ai-admin-message p {
    margin: 8px 0 0;
    line-height: 1.65;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.ai-user-search {
    grid-template-columns: minmax(0, 1fr) auto;
    min-width: 0;
}

@media (max-width: 768px) {
    .app-sidebar {
        display: grid !important;
        grid-template-columns: none !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        justify-content: stretch !important;
        gap: 6px !important;
        overflow-x: hidden !important;
        overflow-y: hidden !important;
    }

    .side-link,
    .side-button {
        flex: initial !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    .side-link span {
        width: 100%;
        font-size: 0.72rem !important;
        line-height: 1.15;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        overflow-wrap: normal !important;
        word-break: keep-all !important;
    }

    .admin-menu-head {
        flex-direction: column;
        gap: 12px;
        padding: 14px;
    }

    .admin-menu-grid {
        grid-template-columns: 1fr;
    }

    .admin-featured-card {
        grid-template-columns: 46px minmax(0, 1fr) auto;
        padding: 14px 16px;
    }

    .admin-featured-icon {
        width: 46px;
        height: 46px;
        font-size: 1.2rem;
    }

    .admin-menu-card {
        grid-template-columns: 44px minmax(0, 1fr) auto;
        padding: 14px;
    }

    .admin-menu-icon {
        width: 44px;
        height: 44px;
    }

    .admin-overview-layout {
        grid-template-columns: 1fr;
    }

    .admin-overview-panel {
        padding: 14px;
    }

    .admin-action-card {
        grid-template-columns: 42px minmax(0, 1fr) auto;
        padding: 12px;
    }

    .admin-action-icon {
        width: 42px;
        height: 42px;
    }

    .ai-chat-layout,
    .ai-admin-layout,
    .ai-record-layout {
        grid-template-columns: 1fr;
    }

    .app-main:has(.ai-immersive-shell) {
        padding: 8px 8px calc(72px + var(--safe-area-bottom)) 8px !important;
    }

    .dashboard-hero:has(+ .ai-chat-layout) {
        display: none;
    }

    .ai-role-select-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .ai-role-select-card {
        grid-template-columns: 42px minmax(0, 1fr) auto;
        padding: 14px;
        border-radius: 8px;
    }

    .ai-immersive-shell {
        min-height: calc(100dvh - 88px - var(--safe-area-bottom));
        height: calc(100dvh - 88px - var(--safe-area-bottom));
        overflow: hidden;
    }

    .ai-chat-layout {
        gap: 8px;
    }

    .ai-role-panel,
    .ai-chat-panel,
    .ai-admin-panel {
        padding: 10px;
        border-radius: 8px;
    }

    .ai-immersive-shell .ai-chat-panel {
        height: 100%;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .ai-role-panel .stats-panel-head {
        display: none;
    }

    .ai-role-list {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 2px;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    .ai-role-item {
        grid-template-columns: 30px max-content;
        flex: 0 0 auto;
        min-width: 132px;
        gap: 7px;
        padding: 8px 10px;
        scroll-snap-align: start;
    }

    .ai-role-icon {
        width: 30px;
        height: 30px;
        font-size: 0.95rem;
    }

    .ai-role-item strong {
        font-size: 0.86rem;
        white-space: nowrap;
    }

    .ai-role-item small {
        display: none;
    }

    .ai-chat-head,
    .ai-record-head {
        align-items: center;
        flex-direction: row;
        margin-bottom: 8px;
    }

    .ai-chat-head h3 {
        font-size: 1rem;
    }

    .ai-chat-head span {
        display: none;
    }

    .ai-chat-head .btn {
        min-height: 34px;
        padding: 0.35rem 0.55rem;
        font-size: 0.82rem;
    }

    .ai-message-list {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
        padding: 8px;
        border-radius: 8px;
    }

    .ai-message-bubble {
        max-width: 86%;
        padding: 8px 10px;
        font-size: 0.9rem;
    }

    .ai-message-bubble span {
        margin-bottom: 2px;
        font-size: 0.7rem;
    }

    .ai-message-bubble p {
        line-height: 1.55;
    }

    .ai-chat-form {
        flex: 0 0 auto;
        gap: 8px;
        margin-top: 8px;
    }

    .ai-input-row {
        grid-template-columns: 42px minmax(0, 1fr) 42px 50px;
        gap: 6px;
    }

    .ai-chat-form textarea {
        min-height: 48px;
        max-height: 96px;
        resize: none;
        font-size: 0.92rem;
        line-height: 1.45;
    }

    .ai-user-search {
        grid-template-columns: 1fr;
    }

    .ai-user-search .btn {
        width: 100%;
    }

    .ai-input-row .btn {
        width: 100%;
        min-width: 0;
        min-height: 48px;
        padding: 0.45rem 0.35rem;
        font-size: 0.92rem;
    }

    .ai-generated-image {
        max-height: 260px;
    }

    .ai-unavailable,
    .ai-empty-chat {
        min-height: 160px;
    }

    .ai-admin-role-card {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .ai-admin-role-card .btn {
        grid-column: 1 / -1;
        width: 100%;
    }
}

@media (max-width: 375px) {
    body { font-size: 14px; }
}

/* 选择文本颜色 */
::selection {
    background: var(--fire-blue);
    color: white;
}

/* 导航栏 - 渐变消防蓝 */
.navbar {
    background: linear-gradient(135deg, var(--fire-blue) 0%, var(--fire-blue-light) 100%) !important;
    box-shadow: var(--shadow-md);
    padding: 0.5rem 0;
    min-height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(10px);
}

.navbar-brand {
    font-weight: 700;
    color: #fff !important;
    font-size: 1.15rem;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-brand i {
    font-size: 1.4rem;
}

.nav-link {
    color: rgba(255,255,255,0.95) !important;
    font-weight: 500;
    padding: 10px 16px !important;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link:active, .nav-link:hover {
    background-color: rgba(255,255,255,0.15);
    color: #fff !important;
    transform: translateY(-1px);
}

/* 移动端导航优化 */
@media (max-width: 991px) {
    .navbar-collapse {
        background: var(--fire-blue);
        margin: 0.5rem -1rem -0.5rem;
        padding: 1rem;
        border-radius: 0 0 var(--border-radius) var(--border-radius);
    }

    .nav-link {
        padding: 12px 16px !important;
        border-radius: var(--border-radius-sm);
        margin-bottom: 4px;
    }
}

/* 卡片 - 现代玻璃态设计 */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(180deg, #fff 0%, #FAFBFC 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: var(--fire-blue);
}

.card-body {
    padding: 1.25rem;
}

.app-shell {
    width: calc(100% - 32px);
    max-width: none;
    margin: 16px auto;
    min-height: calc(100vh - 32px);
    background: rgba(255,255,255,0.78);
    border: 1px solid rgba(208, 224, 248, 0.9);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(15, 70, 153, 0.14);
}

.app-topbar {
    min-height: 92px;
    padding: 0 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    background:
        linear-gradient(90deg, rgba(15, 70, 153, 0.98), rgba(22, 82, 180, 0.96)),
        radial-gradient(circle at 82% 45%, rgba(255,255,255,0.18), transparent 30%);
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #fff;
    text-decoration: none;
}

.brand-lockup strong {
    display: block;
    font-size: 1.45rem;
    line-height: 1.2;
    letter-spacing: 0;
}

.brand-lockup small {
    display: block;
    color: rgba(255,255,255,0.86);
    margin-top: 4px;
    font-size: 0.95rem;
}

.brand-emblem {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #F6C453, #E53935);
    box-shadow: inset 0 0 0 3px rgba(255,255,255,0.32), 0 12px 30px rgba(0,0,0,0.18);
    font-size: 1.8rem;
}

.rescue-logo-mark {
    padding: 0;
    overflow: hidden;
    background: #fff8cf !important;
    border: 2px solid rgba(255, 247, 198, 0.92) !important;
    box-shadow: 0 12px 28px rgba(0, 26, 61, 0.22);
}

.rescue-logo-mark img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 0 0 auto;
}

.topbar-motto {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    margin: 0 18px;
    padding: 8px 12px;
    border-radius: 8px;
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.16);
    font-size: 0.86rem;
    font-weight: 800;
    white-space: nowrap;
}

.topbar-motto span {
    display: inline-block;
}

.topbar-icon,
.user-chip {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
}

.user-chip i {
    font-size: 1.65rem;
}

.logout-link {
    color: rgba(255,255,255,0.88);
    text-decoration: none;
    font-weight: 600;
}

.logout-link:hover {
    color: #fff;
}

.app-body {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    min-height: calc(100vh - 140px);
}

.app-sidebar {
    position: relative;
    padding: 28px 20px;
    background:
        linear-gradient(180deg, #FFFFFF 0%, #F7FAFF 65%, #EDF5FF 100%);
    border-right: 1px solid #DFE9F7;
}

.side-link {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    margin-bottom: 10px;
    color: #334155;
    background: transparent;
    border: 0;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    text-align: left;
}

.side-link i {
    width: 20px;
    color: #64748B;
}

.side-link.active,
.side-link:hover {
    background: linear-gradient(135deg, var(--brand-mid), #3C7CF0);
    color: #fff;
    box-shadow: 0 10px 24px rgba(31, 102, 216, 0.24);
}

.side-link.active i,
.side-link:hover i {
    color: #fff;
}

.side-button {
    cursor: pointer;
}

.side-logout-link {
    margin-top: 18px;
    color: #B91C1C;
    background: #FEF2F2;
}

.side-logout-link i {
    color: #B91C1C;
}

.side-logout-link:hover {
    background: #DC2626;
    color: #fff;
    box-shadow: 0 10px 24px rgba(220, 38, 38, 0.22);
}

.side-logout-link:hover i {
    color: #fff;
}

.sidebar-motto {
    display: none;
}

.app-main {
    padding: 28px;
    min-width: 0;
}

.dashboard-hero {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    padding: 30px 34px;
    color: #fff;
    background:
        linear-gradient(90deg, rgba(31, 102, 216, 0.95), rgba(38, 101, 203, 0.78)),
        radial-gradient(circle at 74% 55%, rgba(255, 200, 120, 0.45), transparent 30%),
        linear-gradient(135deg, #1B5ED2, #0F4699);
    box-shadow: var(--panel-shadow);
}

.dashboard-hero::after {
    content: "";
    position: absolute;
    right: 28px;
    top: 18px;
    width: 190px;
    height: 130px;
    opacity: 0.34;
    background:
        linear-gradient(135deg, transparent 12%, rgba(255,255,255,0.52) 12% 18%, transparent 18% 26%, rgba(255,255,255,0.42) 26% 32%, transparent 32%),
        radial-gradient(circle at 72% 30%, rgba(255,255,255,0.72), transparent 22%);
    clip-path: polygon(50% 0, 92% 18%, 82% 78%, 50% 100%, 18% 78%, 8% 18%);
}

.dashboard-hero h2 {
    margin: 0 0 8px;
    font-size: 1.55rem;
    font-weight: 800;
}

.dashboard-hero p {
    margin: 0;
    color: rgba(255,255,255,0.9);
    line-height: 1.8;
}

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

.metric-card {
    min-height: 112px;
    padding: 20px;
    background: #fff;
    border: 1px solid #E6EEF9;
    border-radius: 8px;
    box-shadow: var(--panel-shadow);
}

.metric-card .metric-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #64748B;
    font-size: 0.86rem;
}

.metric-card .metric-value {
    margin-top: 12px;
    color: #0F172A;
    font-size: 1.55rem;
    font-weight: 800;
}

.metric-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand-mid), #4D86F3);
}

.metric-icon.green { background: linear-gradient(135deg, #22C55E, #5EEAD4); }
.metric-icon.orange { background: linear-gradient(135deg, #F97316, #FDBA74); }
.metric-icon.purple { background: linear-gradient(135deg, #8B5CF6, #C084FC); }

.salary-overview-panel {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) minmax(0, 1.25fr);
    gap: 16px;
    margin: 18px 0;
    padding: 18px;
    background: #fff;
    border: 1px solid #E6EEF9;
    border-radius: 8px;
    box-shadow: var(--panel-shadow);
}

.salary-primary {
    min-width: 0;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 18px;
    border-radius: 8px;
    background: linear-gradient(135deg, #F8FBFF, #EEF6FF);
    border: 1px solid #DCEBFF;
}

.salary-primary-value {
    margin-top: 12px;
    color: #0F172A;
    font-size: 2rem;
    line-height: 1.1;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.salary-primary-meta {
    margin-top: 8px;
    color: #64748B;
    font-weight: 700;
}

.salary-mini-grid {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.salary-mini-item {
    min-width: 0;
    min-height: 76px;
    padding: 12px;
    border: 1px solid #E6EEF9;
    border-radius: 8px;
    background: #FAFCFF;
}

.salary-mini-item span,
.salary-mini-item strong {
    display: block;
    min-width: 0;
}

.salary-mini-item span {
    color: #64748B;
    font-size: 0.82rem;
}

.salary-mini-item strong {
    margin-top: 6px;
    color: #0F172A;
    font-size: 1rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.panel-card {
    background: #fff;
    border: 1px solid #E6EEF9;
    border-radius: 8px;
    box-shadow: var(--panel-shadow);
}

.toolbar-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    margin-bottom: 18px;
    background: #fff;
    border: 1px solid #E6EEF9;
    border-radius: 8px;
    box-shadow: var(--panel-shadow);
}

.toolbar-title h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
}

.toolbar-title span {
    display: block;
    margin-top: 4px;
    color: #64748B;
    font-size: 0.9rem;
}

.toolbar-actions {
    display: grid;
    grid-template-columns: repeat(4, max-content);
    gap: 8px;
    justify-content: end;
}

.search-panel {
    margin-bottom: 14px !important;
}

.admin-filter-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.3fr) repeat(3, minmax(150px, 0.7fr)) minmax(160px, 0.7fr) auto auto;
    gap: 12px;
    align-items: end;
}

.filter-search-main {
    min-width: 0;
}

.filter-field {
    min-width: 0;
}

.filter-label {
    display: block;
    margin-bottom: 6px;
    color: #64748B;
    font-size: 0.78rem;
    font-weight: 800;
}

.filter-submit-btn,
.filter-reset-btn {
    white-space: nowrap;
    min-height: var(--touch-target);
}

.month-filter-wrap {
    position: relative;
    min-width: 0;
}

.month-filter-icon {
    position: absolute;
    left: 14px;
    top: calc(50% + 13px);
    z-index: 2;
    transform: translateY(-50%);
    color: var(--fire-blue);
    pointer-events: none;
}

.month-filter-wrap .form-select {
    height: var(--touch-target);
    padding-left: 42px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    color: #334155;
}

.month-filter-wrap .form-select:focus {
    border-color: var(--fire-blue);
    box-shadow: 0 0 0 4px rgba(21, 101, 192, 0.1);
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 22px 0 12px;
}

.section-title-row h5 {
    margin: 0;
    color: #0F172A;
    font-weight: 800;
}

.section-title-row span {
    color: #94A3B8;
    font-size: 0.9rem;
}

.salary-record-card {
    margin-bottom: 12px;
    background: #fff;
    border: 1px solid #E6EEF9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--panel-shadow);
}

.salary-record-head {
    padding: 18px 20px;
    background: #fff;
    transition: background 0.18s ease;
}

.salary-record-head:hover {
    background: #F7FBFF;
}

.salary-record-head[aria-expanded="true"] {
    background: #F3F8FF;
    border-bottom: 1px solid #E6EEF9;
}

.salary-record-body {
    padding: 16px;
    background: #F8FBFF;
}

.salary-month {
    color: #0F172A;
    font-size: 1rem;
    font-weight: 800;
}

.salary-subtitle {
    margin-top: 4px;
    color: #94A3B8;
    font-size: 0.86rem;
}

.analytics-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
    gap: 16px;
    margin: 18px 0 22px;
}

.analytics-card {
    background: #fff;
    border: 1px solid #E6EEF9;
    border-radius: 8px;
    box-shadow: var(--panel-shadow);
    padding: 20px;
}

.analytics-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.analytics-head h5 {
    margin: 0;
    color: #0F172A;
    font-weight: 800;
}

.analytics-head span {
    color: #94A3B8;
    font-size: 0.84rem;
}

.year-pill {
    padding: 5px 10px;
    border-radius: 999px;
    background: #F1F5F9;
    color: #64748B !important;
    font-weight: 700;
}

.chart-box {
    width: 100%;
    height: 250px;
    min-width: 0;
}

@media (max-width: 1440px) {
    .salary-overview-panel {
        grid-template-columns: minmax(280px, 1fr) minmax(0, 1.2fr);
    }

    .salary-mini-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .salary-mini-item {
        min-height: 86px;
    }
}

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

.dashboard-shortcut-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 18px 0;
}

.shortcut-card {
    min-width: 0;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 18px;
    color: #0F172A;
    text-decoration: none;
    text-align: left;
    background: #fff;
    border: 1px solid #E6EEF9;
    border-radius: 8px;
    box-shadow: var(--panel-shadow);
}

button.shortcut-card {
    width: 100%;
    border: 1px solid #E6EEF9;
}

.shortcut-card strong,
.shortcut-card small {
    display: block;
}

.shortcut-card small {
    margin-top: 3px;
    color: #94A3B8;
}

.shortcut-icon {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand-mid), #4D86F3);
}

.shortcut-icon.green {
    background: linear-gradient(135deg, #22C55E, #5EEAD4);
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    margin-bottom: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand-deep), var(--brand-mid));
    border-radius: 8px;
}

.profile-card h5,
.profile-card p {
    margin: 0;
}

.profile-card p {
    opacity: 0.82;
    margin-top: 4px;
}

.profile-avatar {
    font-size: 2.35rem;
}

.salary-record-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.salary-record-amounts {
    display: flex;
    align-items: center;
    gap: 24px;
}

.detail-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 0.45rem 0;
    border-bottom: 1px solid #F1F5F9;
}

.detail-line span {
    color: #64748B;
}

.detail-line strong {
    color: #0F172A;
    text-align: right;
}

.compact-hero {
    padding: 24px 28px;
}

/* 按钮 - 现代化设计 */
.btn {
    min-height: var(--touch-target);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 1.25rem;
    transition: all 0.2s ease;
    box-shadow: none;
    border: none;
    cursor: pointer;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--fire-blue) 0%, var(--fire-blue-light) 100%);
    color: white;
}

.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, #0D47A1 0%, var(--fire-blue) 100%);
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.4);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--fire-red) 0%, #FF5252 100%);
    color: white;
}

.btn-danger:hover, .btn-danger:focus {
    background: linear-gradient(135deg, #C62828 0%, var(--fire-red) 100%);
    box-shadow: 0 4px 12px rgba(229, 57, 53, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-green) 0%, #34D399 100%);
    color: white;
}

.btn-success:hover, .btn-success:focus {
    background: linear-gradient(135deg, #059669 0%, var(--success-green) 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-outline-success {
    border: 2px solid var(--success-green);
    color: var(--success-green);
    background: transparent;
}

.btn-outline-success:hover {
    background: var(--success-green);
    color: white;
}

.btn-secondary {
    background: #6B7280;
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #0EA5E9 0%, #38BDF8 100%);
    color: white;
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    min-height: 52px;
}

/* 表单输入框 - 现代化 */
.form-control {
    height: var(--touch-target);
    border-radius: var(--border-radius-sm);
    border: 2px solid var(--border-color);
    font-size: 16px; /* 防止iOS缩放 */
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
    background: #fff;
}

.form-control:focus {
    border-color: var(--fire-blue);
    box-shadow: 0 0 0 4px rgba(21, 101, 192, 0.1);
    outline: none;
}

.form-control::placeholder {
    color: #9CA3AF;
}

/* 输入组样式 */
.input-group {
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.input-group .input-group-text {
    background: #F9FAFB;
    border: 2px solid var(--border-color);
    border-right: none;
    color: var(--fire-blue);
    padding: 0 1rem;
}

.input-group .form-control {
    border-left: none;
}

.input-group:focus-within .input-group-text {
    border-color: var(--fire-blue);
}

.input-group:focus-within .form-control {
    border-color: var(--fire-blue);
}

/* 表单标签 */
.form-label {
    font-weight: 600;
    color: var(--text-grey);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

/* 表格优化 */
.table-responsive {
    border-radius: var(--border-radius);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.responsive-scroll-x {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
}

.responsive-scroll-x > table,
.table-responsive > table {
    min-width: max-content;
}

.salary-table-scroll {
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.salary-table-scroll #salary-table {
    min-width: 760px;
}

.table-responsive .table {
    margin-bottom: 0;
}

.admin-orders-table,
.product-admin-table {
    min-width: 980px;
}

.table th {
    background: linear-gradient(180deg, #F9FAFB 0%, #F3F4F6 100%);
    color: var(--fire-blue);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    padding: 1rem;
    white-space: nowrap;
}

.table td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
}

/* Tabulator 样式覆盖 - 现代化 */
.tabulator {
    border: none !important;
    border-radius: var(--border-radius);
    overflow: visible;
    font-size: 0.9rem;
}

.tabulator .tabulator-header {
    background: linear-gradient(180deg, #F9FAFB 0%, #F3F4F6 100%) !important;
    border-bottom: 2px solid var(--fire-blue) !important;
    color: var(--fire-blue) !important;
    font-weight: 600;
}

.tabulator .tabulator-header .tabulator-col {
    background: transparent !important;
    border-right: 1px solid var(--border-color) !important;
}

.tabulator .tabulator-header .tabulator-col:last-child {
    border-right: none !important;
}

.tabulator .tabulator-row {
    border-bottom: 1px solid var(--border-color) !important;
    transition: background 0.15s ease;
}

.tabulator .tabulator-row:hover {
    background: #F0F9FF !important;
}

.tabulator .tabulator-row.tabulator-selected {
    background: rgba(21, 101, 192, 0.08) !important;
}

.tabulator .tabulator-row.tabulator-selected:hover {
    background: rgba(21, 101, 192, 0.12) !important;
}

.tabulator .tabulator-cell {
    padding: 12px 10px !important;
}

.table-action-group {
    display: grid;
    grid-template-columns: repeat(3, 34px);
    gap: 6px;
    justify-content: center;
}

.table-action-group .btn {
    width: 34px;
    min-width: 34px;
    min-height: 32px;
    padding: 0;
    border-radius: 7px;
}

/* 移动端优化 */
@media (max-width: 576px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .card {
        border-radius: var(--border-radius-sm);
        margin-bottom: 0.75rem;
    }

    .card-body {
        padding: 0.875rem;
    }

    .card-header {
        padding: 0.75rem;
    }

    /* 标题栏响应式 */
    .page-header.d-flex.justify-content-between {
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px;
    }

    /* 按钮 */
    .btn-mobile-full {
        width: 100%;
    }

    /* 模态框优化 */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    /* 工资金额 */
    .salary-amount {
        font-size: 1rem !important;
    }

    /* 页面标题 */
    .page-title {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }

    /* 日历图标缩小 */
    .calendar-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    /* 导航栏 */
    .navbar {
        padding: 0.5rem 0;
    }

    .navbar-brand {
        font-size: 1.05rem;
    }

    /* 空状态 */
    .empty-state {
        padding: 2rem 1rem;
    }

    .empty-state i {
        font-size: 3rem;
    }
}

/* 平板优化 */
@media (min-width: 577px) and (max-width: 991px) {
    .container {
        max-width: 100%;
        padding-left: 24px;
        padding-right: 24px;
    }

    .salary-overview-panel {
        grid-template-columns: 1fr;
    }

    .toolbar-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .toolbar-actions .btn {
        width: 100%;
    }

    .admin-filter-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-search-main {
        grid-column: 1 / -1;
    }

    .filter-submit-btn,
    .filter-reset-btn {
        width: 100%;
    }
}

/* 大屏优化 */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }

    .app-main {
        padding: 24px;
    }
}

@media (min-width: 1800px) {
    .app-shell {
        width: calc(100% - 24px);
        margin-top: 12px;
        margin-bottom: 12px;
        min-height: calc(100vh - 24px);
    }
}

/* 消防元素装饰 - 更精致 */
.fire-stripe {
    height: 3px;
    background: linear-gradient(90deg, var(--fire-blue) 0%, var(--fire-blue-light) 50%, var(--fire-red) 100%);
    margin-bottom: 1rem;
    border-radius: 2px;
}

/* 详情列表样式 - 优化 */
.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0;
    border-bottom: 1px solid #F3F4F6;
}

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

.detail-label {
    color: var(--text-grey);
    font-size: 0.9rem;
}

.detail-value {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.detail-value.income {
    color: var(--fire-blue);
}

.detail-value.deduct {
    color: var(--fire-red);
}

/* 工资卡片样式 */
.salary-card {
    border: none;
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all 0.3s ease;
}

.salary-card:hover {
    box-shadow: var(--shadow-md);
}

.salary-card .card-header {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s ease;
}

.salary-card .card-header:hover {
    background: #F9FAFB;
}

.salary-card .card-header[aria-expanded="true"] {
    background: #F0F9FF;
}

/* 工资金额高亮 */
.salary-amount {
    font-size: 1.25rem;
    font-weight: 700;
}

.salary-amount.central {
    color: var(--fire-blue);
}

.salary-amount.local {
    color: var(--success-green);
}

/* 工资详情区块 */
.salary-detail-section {
    background: #fff;
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    height: 100%;
}

.salary-detail-section h6 {
    font-weight: 700;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid currentColor;
}

/* 汇总区块 */
.salary-summary {
    background: #F9FAFB;
    border-radius: var(--border-radius-sm);
    padding: 0.875rem;
    margin-top: 1rem;
}

.salary-summary .total-row {
    display: flex;
    justify-content: space-between;
    padding: 0.375rem 0;
    font-size: 0.9rem;
}

.salary-summary .final-row {
    border-top: 2px solid var(--border-color);
    margin-top: 0.5rem;
    padding-top: 0.625rem;
    font-weight: 700;
}

.display-item-row:last-child {
    border-bottom: none !important;
}

.display-toggle-btn {
    min-height: 34px;
    padding: 0.25rem 0.75rem;
}

.compact-btn {
    min-height: 36px;
    padding: 0.35rem 0.75rem;
}

.extra-field-list {
    background: #F9FAFB;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem;
}

.extra-field-row:last-child {
    margin-bottom: 0 !important;
}

.tabulator-footer {
    background: #fff !important;
    border-top: 1px solid var(--border-color) !important;
}

.tabulator .tabulator-footer .tabulator-page {
    border-radius: 6px !important;
    border: 1px solid var(--border-color) !important;
    min-width: 34px;
}

.tabulator .tabulator-footer .tabulator-page.active {
    background: var(--fire-blue) !important;
    color: #fff !important;
}

@media (max-width: 576px) {
    .display-toggle-btn {
        width: 100%;
        margin-top: 0.5rem;
    }

}

/* Final mobile app-shell overrides. These stay at the end so desktop rules above cannot re-expand the layout. */
@media (max-width: 768px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        background: #F4F8FF;
        font-size: 15px;
    }

    body > .container {
        width: 100%;
        max-width: 100%;
        padding-left: 12px;
        padding-right: 12px;
    }

    .app-shell {
        width: 100%;
        margin: 0;
        min-height: 100vh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .app-topbar {
        min-height: 76px;
        padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 12px;
        gap: 10px;
    }

    .topbar-motto {
        order: 3;
        width: 100%;
        margin: 0;
        padding: 6px 8px;
        gap: 6px;
        font-size: 0.72rem;
    }

    .brand-lockup {
        min-width: 0;
        gap: 10px;
    }

    .brand-lockup strong {
        max-width: 58vw;
        font-size: 1rem;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .brand-lockup small {
        font-size: 0.78rem;
    }

    .brand-emblem {
        width: 42px;
        height: 42px;
        font-size: 1.25rem;
        flex: 0 0 auto;
    }

    .topbar-actions {
        flex: 0 0 auto;
        gap: 8px;
    }

    .topbar-icon {
        display: none;
    }

    .user-chip {
        min-height: 34px;
        font-size: 0;
    }

    .user-chip i {
        font-size: 1.35rem;
    }

    .logout-link {
        font-size: 0.82rem;
        white-space: nowrap;
    }

    .app-body {
        display: block;
        min-height: auto;
    }

    .app-sidebar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1040;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 4px;
        padding: 8px 8px calc(8px + var(--safe-area-bottom));
        border-top: 1px solid #DFE9F7;
        border-right: 0;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 -12px 30px rgba(15, 70, 153, 0.10);
    }

    .side-link {
        min-height: 50px;
        flex-direction: column;
        justify-content: center;
        gap: 3px;
        margin: 0;
        padding: 4px;
        border-radius: 8px;
        font-size: 0.74rem;
        text-align: center;
    }

    .side-link i {
        width: auto;
        font-size: 1.05rem;
    }

    .sidebar-motto {
        display: none;
    }

    .app-main {
        width: 100%;
        min-width: 0;
        padding: 14px 12px calc(82px + var(--safe-area-bottom));
    }

    .dashboard-hero,
    .compact-hero {
        padding: 20px 18px;
    }

    .dashboard-hero h2 {
        font-size: 1.2rem;
    }

    .dashboard-hero p {
        font-size: 0.92rem;
        line-height: 1.65;
    }

    .dashboard-hero::after {
        right: -30px;
        top: 8px;
        width: 150px;
        height: 110px;
        opacity: 0.22;
    }

    .metric-grid,
    .analytics-grid,
    .dashboard-shortcut-row {
        grid-template-columns: 1fr;
        gap: 10px;
        margin: 12px 0;
    }

    .metric-card {
        min-height: 96px;
        padding: 15px;
    }

    .metric-card .metric-value {
        font-size: 1.12rem;
        overflow-wrap: anywhere;
    }

    .analytics-card {
        padding: 14px;
    }

    .analytics-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .chart-box {
        height: 220px;
        max-width: 100%;
        overflow: hidden;
    }

    .shortcut-card {
        grid-template-columns: 40px minmax(0, 1fr) auto;
        padding: 14px;
        gap: 10px;
    }

    .shortcut-card strong,
    .shortcut-card small {
        overflow-wrap: anywhere;
    }

    .shortcut-icon {
        width: 40px;
        height: 40px;
        border-radius: 8px;
    }

    .section-title-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
        margin: 16px 0 10px;
    }

    .salary-record-head {
        padding: 14px;
    }

    .salary-record-body {
        padding: 12px;
    }

    .salary-record-summary,
    .salary-record-amounts {
        width: 100%;
    }

    .salary-record-summary {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .salary-record-amounts {
        justify-content: space-between;
        gap: 8px;
    }

    .salary-record-amounts .text-end {
        min-width: 0;
        text-align: left !important;
    }

    .detail-line {
        align-items: flex-start;
        gap: 10px;
    }

    .detail-line span,
    .detail-line strong,
    .detail-value {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }

    .modal-content {
        max-height: calc(100vh - 20px);
        overflow: auto;
    }

}

@media (max-width: 380px) {
    .brand-lockup strong {
        max-width: 52vw;
        font-size: 0.92rem;
    }

    .brand-lockup small {
        font-size: 0.72rem;
    }

    .brand-emblem {
        width: 38px;
        height: 38px;
    }

    .side-link {
        font-size: 0.68rem;
    }
}

/* 实用工具类 */
.text-fire-blue { color: var(--fire-blue) !important; }
.text-fire-red { color: var(--fire-red) !important; }
.bg-fire-blue { background-color: var(--fire-blue) !important; }

/* 个人信息卡片 */
.info-box {
    background: linear-gradient(135deg, #F9FAFB 0%, #F3F4F6 100%);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    height: 100%;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.info-box:hover {
    background: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 100%);
    border-color: var(--fire-blue-light);
}

.info-box small {
    color: var(--text-grey);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-box .value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-top: 0.25rem;
}

/* 页面标题样式 */
.page-title {
    font-weight: 700;
    color: var(--text-dark);
    padding-left: 1rem;
    border-left: 4px solid var(--fire-red);
    margin-bottom: 1.5rem;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.empty-state i {
    font-size: 4rem;
    color: #D1D5DB;
    margin-bottom: 1rem;
}

.empty-state h4 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-grey);
}

/* 徽章样式 */
.badge-status {
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* 日历图标圆形背景 */
.calendar-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--fire-blue) 0%, var(--fire-blue-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.3);
    flex-shrink: 0;
}

/* 折叠箭头动画 */
.collapse-arrow {
    transition: transform 0.3s ease;
}

[aria-expanded="true"] .collapse-arrow {
    transform: rotate(180deg);
}

/* Alert 样式优化 */
.alert {
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-warning {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    color: #92400E;
}

.alert-success {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    color: #065F46;
}

.alert-danger {
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
    color: #991B1B;
}

.alert-info {
    background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%);
    color: #1E40AF;
}

/* 模态框优化 */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: linear-gradient(180deg, #F9FAFB 0%, #F3F4F6 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    background: #F9FAFB;
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

#editSalaryModal .modal-dialog {
    max-height: calc(100vh - 1rem);
}

#editSalaryModal .modal-content {
    max-height: calc(100vh - 1rem);
}

.edit-salary-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
}

.edit-salary-form .modal-body {
    max-height: calc(100vh - 190px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.edit-salary-form .modal-footer {
    flex: 0 0 auto;
}

#editStandardFields {
    padding-bottom: 0.25rem;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--fire-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 渐入动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #F3F4F6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* iOS 安全区域适配 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    body {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Last-pass mobile fixes: keep these at EOF so shared component rules do not override phone layout. */
@media (max-width: 768px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .app-shell {
        width: 100%;
        margin: 0;
        min-height: 100vh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .app-topbar {
        min-height: 76px;
        padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 12px;
    }

    .brand-lockup {
        min-width: 0;
    }

    .brand-lockup strong {
        max-width: 58vw;
        font-size: 1rem;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .app-body {
        display: block;
        min-height: auto;
    }

    .app-sidebar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1040;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 4px;
        padding: 8px 8px calc(8px + var(--safe-area-bottom));
        border-top: 1px solid #DFE9F7;
        border-right: 0;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 -12px 30px rgba(15, 70, 153, 0.10);
    }

    .side-link {
        min-height: 50px;
        flex-direction: column;
        justify-content: center;
        gap: 3px;
        margin: 0;
        padding: 4px;
        font-size: 0.74rem;
        text-align: center;
    }

    .side-link i {
        width: auto;
    }

    .sidebar-motto {
        display: none;
    }

    .app-main {
        width: 100%;
        min-width: 0;
        padding: 14px 12px calc(82px + var(--safe-area-bottom));
    }

    .metric-grid,
    .analytics-grid,
    .dashboard-shortcut-row {
        grid-template-columns: 1fr;
    }

    .salary-overview-panel {
        grid-template-columns: 1fr;
        gap: 12px;
        margin: 12px 0;
        padding: 12px;
    }

    .salary-primary {
        padding: 14px;
    }

    .salary-primary-value {
        font-size: 1.55rem;
    }

    .salary-mini-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .salary-mini-item {
        min-height: 68px;
        padding: 10px;
    }

    .toolbar-panel {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
        padding: 14px;
        margin-bottom: 12px;
    }

    .toolbar-actions {
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .toolbar-actions .btn {
        width: 100%;
        min-height: 42px;
        padding: 0.45rem 0.5rem;
        font-size: 0.86rem;
    }

    .panel-card .card-header {
        padding: 12px;
    }

    .search-panel {
        margin-bottom: 12px !important;
    }

    .admin-filter-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .filter-search-main {
        grid-column: auto;
    }

    .filter-reset-btn {
        width: 100%;
    }

    .tabulator {
        font-size: 0.82rem;
        min-width: 760px;
    }

    .tabulator .tabulator-cell {
        padding: 10px 8px !important;
    }

    .tabulator .tabulator-header-filter input {
        min-height: 32px;
        height: 32px;
        padding: 4px 6px;
        font-size: 14px;
    }

    .tabulator .tabulator-footer {
        white-space: normal;
    }

    .table-action-group {
        grid-template-columns: repeat(3, 32px);
        gap: 4px;
    }

    .table-action-group .btn {
        width: 32px;
        min-width: 32px;
        min-height: 30px;
    }

    .table-responsive,
    .responsive-scroll-x {
        overflow-x: auto !important;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .salary-record-body.responsive-scroll-x {
        padding-bottom: 8px;
    }

    #editSalaryModal .modal-dialog,
    #detailModal .modal-dialog,
    #importHistoryModal .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100%;
    }

    #editSalaryModal .modal-content,
    #detailModal .modal-content,
    #importHistoryModal .modal-content {
        max-height: 100svh;
        min-height: 100svh;
        border-radius: 0;
    }

    .edit-salary-form .modal-body {
        max-height: calc(100svh - 150px);
    }

    .extra-field-row {
        align-items: stretch !important;
    }

    .extra-field-row > [class*="col-"] {
        width: 100%;
    }

    .salary-record-summary {
        align-items: stretch;
        flex-direction: column;
    }

    .salary-record-amounts {
        width: 100%;
        justify-content: space-between;
    }

}

@media (max-width: 420px) {
    .salary-mini-grid,
    .toolbar-actions {
        grid-template-columns: 1fr;
    }

    .salary-primary-value {
        font-size: 1.38rem;
    }

    .toolbar-title h3 {
        font-size: 1rem;
    }

    .toolbar-title span {
        font-size: 0.82rem;
    }
}

/* 2026 visual refresh: blue-white fire rescue UI */
:root {
    --rescue-blue-950: #06204A;
    --rescue-blue-900: #0B3476;
    --rescue-blue-700: #1557C6;
    --rescue-blue-500: #2D8CFF;
    --rescue-sky: #EAF4FF;
    --rescue-red: #E9342A;
    --rescue-gold: #FFC247;
    --rescue-line: rgba(26, 91, 190, 0.14);
    --rescue-shadow: 0 18px 48px rgba(9, 42, 98, 0.13);
}

body {
    background:
        radial-gradient(circle at 12% 10%, rgba(45, 140, 255, 0.18), transparent 28%),
        radial-gradient(circle at 88% 18%, rgba(233, 52, 42, 0.09), transparent 25%),
        linear-gradient(180deg, #EAF4FF 0%, #F8FBFF 48%, #FFFFFF 100%);
}

main.login-main {
    width: 100%;
    max-width: 1520px;
    padding: 0 16px 16px;
}

.app-shell {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(137, 181, 238, 0.55);
    box-shadow: 0 26px 80px rgba(6, 32, 74, 0.16);
}

.app-topbar {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(105deg, rgba(6, 32, 74, 0.98) 0%, rgba(15, 73, 164, 0.97) 56%, rgba(26, 105, 218, 0.94) 100%);
}

.app-topbar::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, transparent 0 48%, rgba(255, 255, 255, 0.12) 48% 49%, transparent 49% 58%, rgba(255, 194, 71, 0.24) 58% 59%, transparent 59%),
        radial-gradient(circle at 88% 16%, rgba(233, 52, 42, 0.32), transparent 20%);
    pointer-events: none;
}

.app-topbar > * {
    position: relative;
    z-index: 1;
}

.brand-emblem {
    background: linear-gradient(135deg, var(--rescue-red), var(--rescue-gold));
    box-shadow: inset 0 0 0 3px rgba(255,255,255,0.35), 0 16px 34px rgba(233, 52, 42, 0.24);
}

.brand-emblem.rescue-logo-mark {
    background: #fff8cf !important;
    box-shadow: 0 12px 30px rgba(0,0,0,0.18);
}

.side-link {
    color: #29415F;
}

.side-link.active,
.side-link:hover {
    background: linear-gradient(135deg, var(--rescue-blue-700), var(--rescue-blue-500));
    box-shadow: 0 12px 28px rgba(21, 87, 198, 0.26);
}

.sidebar-motto {
    color: rgba(15, 73, 164, 0.28);
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    color: #fff;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.22);
    backdrop-filter: blur(14px);
    font-size: 0.88rem;
    font-weight: 800;
}

.form-control,
.month-filter-wrap .form-select {
    border-color: #D8E6F7;
    background: #FBFDFF;
}

.input-group .input-group-text {
    border-color: #D8E6F7;
    background: #F0F7FF;
}

.btn-primary {
    background: linear-gradient(135deg, var(--rescue-blue-700), var(--rescue-blue-500));
    box-shadow: 0 12px 24px rgba(21, 87, 198, 0.22);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--rescue-blue-900), var(--rescue-blue-700));
}

.btn-danger {
    background: linear-gradient(135deg, #C8221B, var(--rescue-red));
}

.dashboard-hero.fire-hero {
    min-height: 285px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    padding: clamp(26px, 4vw, 46px);
    background:
        linear-gradient(90deg, rgba(6, 32, 74, 0.96) 0%, rgba(14, 70, 156, 0.84) 42%, rgba(14, 70, 156, 0.28) 66%, rgba(14, 70, 156, 0.02) 100%),
        url("/static/images/20260514-175519-opt.webp") right center / cover no-repeat;
    border: 1px solid rgba(255,255,255,0.55);
    border-radius: 14px;
    box-shadow: var(--rescue-shadow);
    isolation: isolate;
}

.dashboard-hero.fire-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(6, 32, 74, 0.10), transparent 52%),
        radial-gradient(circle at 80% 22%, rgba(255, 194, 71, 0.16), transparent 20%);
    pointer-events: none;
    z-index: -1;
}

.dashboard-hero.fire-hero::after {
    opacity: 0;
}

.hero-copy {
    max-width: 650px;
}

.hero-copy h2 {
    margin: 14px 0 8px;
    font-size: clamp(1.75rem, 3.4vw, 3rem);
    line-height: 1.15;
    font-weight: 900;
}

.hero-copy p {
    max-width: 560px;
    font-size: 1rem;
    line-height: 1.75;
}

.hero-status-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-status-strip span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 8px;
    color: #fff;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.22);
    backdrop-filter: blur(12px);
    font-weight: 800;
}

.metric-card,
.salary-overview-panel,
.analytics-card,
.shortcut-card,
.toolbar-panel,
.panel-card,
.salary-record-card {
    border-color: var(--rescue-line);
    border-radius: 10px;
    box-shadow: var(--rescue-shadow);
}

.metric-card,
.analytics-card,
.toolbar-panel,
.panel-card,
.salary-record-card,
.shortcut-card {
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.metric-card:hover,
.analytics-card:hover,
.shortcut-card:hover,
.salary-record-card:hover {
    transform: translateY(-2px);
    border-color: rgba(21, 87, 198, 0.28);
    box-shadow: 0 22px 54px rgba(9, 42, 98, 0.16);
}

.salary-primary {
    background:
        linear-gradient(135deg, rgba(234, 244, 255, 0.95), rgba(255,255,255,0.86)),
        linear-gradient(90deg, rgba(233, 52, 42, 0.08), transparent 44%);
}

.salary-primary-value,
.metric-card .metric-value {
    color: var(--rescue-blue-950);
}

.metric-icon,
.shortcut-icon {
    border-radius: 10px;
    background: linear-gradient(135deg, var(--rescue-blue-700), var(--rescue-blue-500));
}

.metric-icon.orange {
    background: linear-gradient(135deg, var(--rescue-red), var(--rescue-gold));
}

.metric-icon.purple {
    background: linear-gradient(135deg, #5B5FE8, #3DB8FF);
}

.tabulator {
    border-radius: 10px;
}

.tabulator .tabulator-header {
    background: linear-gradient(180deg, #F5FAFF 0%, #EAF4FF 100%) !important;
    border-bottom-color: var(--rescue-blue-700) !important;
}

.salary-detail-section {
    border: 1px solid var(--rescue-line);
    box-shadow: none;
}

@keyframes heroGlow {
    0%, 100% { opacity: 0.55; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.08); }
}

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

@media (max-width: 991px) {
    .dashboard-hero.fire-hero {
        min-height: 200px;
        background-position: 58% center;
    }
}

@media (max-width: 768px) {
    body {
        background: #F3F8FF;
    }

    body > .container {
        padding-left: 0;
        padding-right: 0;
    }

    .app-topbar {
        min-height: 74px;
    }

    .app-sidebar {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        border-top-color: rgba(21, 87, 198, 0.18);
    }

    .dashboard-hero.fire-hero,
    .dashboard-hero.fire-hero.compact-hero {
        min-height: 235px;
        padding: 18px;
        border-radius: 12px;
        background:
            linear-gradient(90deg, rgba(6, 32, 74, 0.95) 0%, rgba(14, 70, 156, 0.80) 58%, rgba(14, 70, 156, 0.18) 100%),
            url("/static/images/20260514-175519-opt.webp") 76% center / cover no-repeat;
    }

    .hero-copy {
        max-width: 68%;
    }

    .hero-kicker {
        padding: 6px 10px;
        font-size: 0.78rem;
    }

    .hero-copy h2 {
        margin-top: 10px;
        font-size: 1.28rem;
    }

    .hero-copy p {
        font-size: 0.88rem;
        line-height: 1.6;
    }

    .hero-status-strip span {
        min-height: 34px;
        padding: 6px 10px;
        font-size: 0.78rem;
    }

    .metric-card,
    .analytics-card,
    .shortcut-card,
    .toolbar-panel,
    .panel-card,
    .salary-record-card,
    .salary-overview-panel {
        border-radius: 10px;
        box-shadow: 0 10px 26px rgba(9, 42, 98, 0.10);
    }
}

@media (max-width: 430px) {
    .hero-copy {
        max-width: 72%;
    }

    .dashboard-hero.fire-hero {
        background-position: right center, 76% center;
    }
}

/* Compression-first responsive overrides:
   keep control groups in their original layout, shrink text first, then allow local scrolling. */
.brand-lockup,
.toolbar-panel,
.toolbar-actions,
.hero-status-strip,
.metric-label,
.shortcut-card,
.salary-record-summary,
.salary-record-amounts,
.section-title-row,
.analytics-head,
.detail-line,
.salary-summary .total-row {
    min-width: 0;
}

.brand-lockup strong,
.brand-lockup small,
.side-link span,
.toolbar-title h3,
.toolbar-title span,
.toolbar-actions .btn,
.filter-submit-btn,
.filter-reset-btn,
.hero-kicker,
.hero-status-strip span,
.metric-card .metric-label,
.metric-card .metric-value,
.salary-primary-meta,
.salary-mini-item span,
.salary-mini-item strong,
.shortcut-card strong,
.shortcut-card small,
.section-title-row h5,
.section-title-row span,
.analytics-head h5,
.analytics-head span,
.year-pill,
.salary-month,
.salary-subtitle,
.salary-record-amounts small,
.salary-record-amounts span,
.detail-line span,
.detail-line strong,
.detail-value,
.salary-summary .total-row span {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
}

.toolbar-panel,
.hero-status-strip,
.salary-record-summary,
.salary-record-amounts,
.section-title-row,
.analytics-head,
.detail-line,
.salary-summary .total-row {
    flex-wrap: nowrap;
}

.toolbar-actions .btn,
.filter-submit-btn,
.filter-reset-btn,
.side-link,
.hero-status-strip span,
.shortcut-card {
    white-space: nowrap;
}

.side-link span {
    display: block;
}

[data-fitty] {
    display: inline-block;
    max-width: 100%;
    min-width: 0;
    white-space: nowrap;
    vertical-align: bottom;
}

.hero-status-strip span[data-fitty],
.side-link span[data-fitty] {
    display: inline-flex;
    align-items: center;
}

.side-link span[data-fitty],
.shortcut-card strong[data-fitty] {
    pointer-events: none;
}

.metric-card .metric-value[data-fitty],
.salary-primary-value[data-fitty],
.salary-mini-item strong[data-fitty],
.detail-value[data-fitty],
.salary-summary .total-row span[data-fitty] {
    width: 100%;
}

/* Keep dashboard mini-metrics readable on split/narrow viewports. */
.salary-mini-item span,
.salary-mini-item strong {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

@media (max-width: 1199px) {
    .brand-lockup strong {
        font-size: clamp(0.95rem, 1.6vw, 1.25rem);
    }

    .brand-lockup small {
        font-size: clamp(0.72rem, 1.1vw, 0.88rem);
    }

    .app-sidebar {
        width: 210px;
    }

    .app-body {
        grid-template-columns: 210px minmax(0, 1fr);
    }

    .side-link {
        gap: 8px;
        padding: 0 10px;
        font-size: clamp(0.7rem, 1vw, 0.88rem);
    }

    .toolbar-panel {
        gap: 10px;
        padding: 14px;
        overflow-x: auto;
    }

    .toolbar-title h3 {
        font-size: clamp(0.95rem, 1.35vw, 1.14rem);
    }

    .toolbar-title span {
        font-size: clamp(0.72rem, 1vw, 0.84rem);
    }

    .toolbar-actions {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
        min-width: min(620px, 64vw);
    }

    .toolbar-actions .btn {
        min-height: 40px;
        padding: 0.42rem 0.55rem;
        font-size: clamp(0.7rem, 1vw, 0.86rem);
    }

    .admin-filter-row {
        grid-template-columns: minmax(170px, 1.2fr) repeat(3, minmax(108px, 0.62fr)) minmax(124px, 0.68fr) minmax(92px, auto) minmax(92px, auto);
        gap: 8px;
        min-width: 820px;
    }

    .search-panel .card-body {
        overflow-x: auto;
    }

    .filter-label {
        font-size: clamp(0.64rem, 0.9vw, 0.76rem);
    }

    .admin-filter-row .form-control,
    .admin-filter-row .form-select,
    .filter-submit-btn,
    .filter-reset-btn {
        min-height: 40px;
        height: 40px;
        font-size: clamp(0.72rem, 1vw, 0.88rem);
    }

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

    .metric-card {
        min-height: 96px;
        padding: 14px;
    }

    .metric-card .metric-label {
        font-size: clamp(0.68rem, 1vw, 0.82rem);
    }

    .metric-card .metric-value {
        font-size: clamp(1rem, 1.7vw, 1.36rem);
    }

    .hero-copy h2 {
        font-size: clamp(1.28rem, 2.4vw, 2.05rem);
    }

    .hero-copy p,
    .hero-status-strip span {
        font-size: clamp(0.74rem, 1.15vw, 0.94rem);
    }
}

@media (min-width: 577px) and (max-width: 991px) {
    .salary-overview-panel {
        grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1.15fr);
    }

    .toolbar-panel {
        align-items: center;
        flex-direction: row;
        overflow-x: auto;
    }

    .toolbar-actions {
        width: auto;
    }

    .toolbar-actions .btn,
    .filter-submit-btn,
    .filter-reset-btn {
        width: auto;
    }

    .admin-filter-row {
        min-width: 820px;
    }

    .search-panel .card-body {
        overflow-x: auto;
    }

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

    .analytics-grid,
    .dashboard-shortcut-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .app-topbar {
        align-items: center;
    }

    .brand-lockup strong {
        max-width: 54vw;
        font-size: clamp(0.76rem, 3.3vw, 1rem);
        overflow-wrap: normal;
    }

    .brand-lockup small {
        font-size: clamp(0.62rem, 2.6vw, 0.78rem);
    }

    .logout-link {
        font-size: clamp(0.66rem, 2.8vw, 0.82rem);
    }

    .side-link {
        font-size: clamp(0.58rem, 2.55vw, 0.74rem);
    }

    .dashboard-hero.fire-hero,
    .dashboard-hero.fire-hero.compact-hero {
        min-height: 164px;
    }

    .hero-copy {
        max-width: 78%;
    }

    .hero-kicker,
    .hero-status-strip span {
        font-size: clamp(0.62rem, 2.45vw, 0.78rem);
    }

    .hero-copy h2 {
        font-size: clamp(1.05rem, 4vw, 1.28rem);
    }

    .hero-copy p {
        font-size: clamp(0.72rem, 2.8vw, 0.88rem);
        line-height: 1.45;
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .metric-card {
        min-height: 86px;
        padding: 12px;
    }

    .metric-card .metric-value,
    .salary-primary-value {
        overflow-wrap: normal;
        font-size: clamp(0.96rem, 4.2vw, 1.28rem);
    }

    .salary-mini-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .salary-mini-item {
        min-height: 62px;
    }

    .salary-mini-item span {
        font-size: clamp(0.62rem, 2.5vw, 0.8rem);
    }

    .salary-mini-item strong {
        font-size: clamp(0.72rem, 2.8vw, 0.94rem);
    }

    .toolbar-panel {
        align-items: center;
        flex-direction: row;
        overflow-x: auto;
    }

    .toolbar-actions {
        width: auto;
        grid-template-columns: repeat(4, minmax(86px, 1fr));
        min-width: 430px;
    }

    .toolbar-actions .btn {
        width: auto;
        font-size: clamp(0.62rem, 2.45vw, 0.78rem);
    }

    .shortcut-card {
        grid-template-columns: 38px minmax(0, 1fr) auto;
        gap: 8px;
        padding: 12px;
    }

    .shortcut-card strong {
        font-size: clamp(0.8rem, 3.2vw, 0.98rem);
    }

    .shortcut-card small {
        font-size: clamp(0.66rem, 2.55vw, 0.82rem);
    }

    .section-title-row,
    .analytics-head,
    .salary-record-summary,
    .salary-record-amounts {
        align-items: center;
        flex-direction: row;
    }

    .salary-record-amounts {
        width: auto;
        gap: 10px;
    }

    .salary-record-amounts .text-end {
        text-align: right !important;
    }

    .salary-record-amounts small {
        font-size: clamp(0.58rem, 2.25vw, 0.74rem);
    }

    .salary-record-amounts span {
        font-size: clamp(0.7rem, 2.75vw, 0.88rem);
    }

    .detail-line {
        align-items: center;
    }
}

/* Authenticated pages no longer show the global top bar. */
.app-topbar {
    display: none !important;
}

.app-body {
    min-height: calc(100vh - 32px);
}

@media (max-width: 768px) {
    .app-body {
        min-height: 100vh;
    }
}

.admin-hero .hero-kicker,
.admin-hero .hero-status-strip,
.user-hero .hero-kicker,
.user-hero .hero-status-strip,
.user-hero .hero-copy p {
    display: none !important;
}

.salary-primary .metric-icon {
    display: none !important;
}

.user-hero {
    position: relative;
}

.hero-logout-btn {
    position: absolute;
    right: 18px;
    top: 18px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.24);
}

.hero-logout-btn:hover,
.hero-logout-btn:focus {
    color: #fff;
    background: rgba(255, 255, 255, 0.24);
}

.shop-placeholder {
    min-height: calc(100vh - 220px);
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    padding: 42px 18px;
    text-align: center;
    background: #fff;
    border: 1px solid #E6EEF9;
    border-radius: 10px;
    box-shadow: var(--panel-shadow);
}

.shop-placeholder-icon {
    width: 72px;
    height: 72px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    color: #fff;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--rescue-blue-700), var(--rescue-blue-500));
}

.shop-placeholder h2,
.shop-placeholder p {
    margin: 0;
}

.shop-placeholder p {
    color: #64748B;
}

.shop-hero .hero-status-strip {
    align-self: end;
}

.shop-filter-bar,
.product-admin-filters {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 180px auto auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}

.shop-search .input-group-text,
.product-admin-filters .input-group-text {
    background: #fff;
}

.shop-category-select {
    min-width: 160px;
}

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

.shop-product-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid #E6EEF9;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(15, 70, 153, 0.08);
}

.shop-product-media {
    position: relative;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, #EEF5FF, #FFF7E6);
}

.shop-product-media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.shop-product-fallback {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: #1F66D8;
    font-size: 3rem;
}

.shop-product-badge,
.status-pill,
.stock-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.shop-product-badge {
    position: absolute;
    left: 12px;
    top: 12px;
    color: #0F4699;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(31, 102, 216, 0.18);
}

.shop-product-body {
    padding: 14px;
}

.shop-product-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.shop-product-title-row h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.35;
}

.shop-product-body p {
    min-height: 44px;
    margin: 8px 0 14px;
    color: #64748B;
    font-size: 0.9rem;
}

.shop-product-meta {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.price {
    color: #D62828;
    font-size: 1.2rem;
    font-weight: 800;
}

.original-price {
    color: #94A3B8;
    font-size: 0.82rem;
    text-decoration: line-through;
}

.stock-text {
    color: #475569;
    font-size: 0.86rem;
    white-space: nowrap;
}

.stock-pill {
    color: #047857;
    background: #DCFCE7;
}

.stock-pill.warning {
    color: #92400E;
    background: #FEF3C7;
}

.stock-pill.danger {
    color: #B91C1C;
    background: #FEE2E2;
}

.shop-empty {
    display: grid;
    place-items: center;
    min-height: 320px;
    padding: 38px 18px;
    text-align: center;
    background: #fff;
    border: 1px dashed #C8D8EC;
    border-radius: 8px;
}

.shop-empty i {
    color: #94A3B8;
    font-size: 2.6rem;
}

.shop-empty h3 {
    margin: 10px 0 4px;
    font-size: 1.1rem;
    font-weight: 800;
}

.shop-empty p {
    margin: 0;
    color: #64748B;
}

.product-admin-panel .card-body {
    padding: 14px;
}

.product-admin-filters {
    grid-template-columns: minmax(220px, 1fr) 180px 150px auto;
    margin-bottom: 0;
}

.product-table-wrap {
    overflow-x: auto;
}

.product-table {
    min-width: 820px;
}

.product-table th {
    color: #475569;
    font-size: 0.84rem;
    font-weight: 800;
    background: #F8FAFC;
    border-top: 1px solid #E6EEF9;
}

.product-row-main {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.product-row-image {
    width: 58px;
    height: 58px;
    overflow: hidden;
    display: grid;
    place-items: center;
    color: #1F66D8;
    background: #EEF5FF;
    border: 1px solid #E6EEF9;
    border-radius: 8px;
}

.product-row-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-row-meta,
.product-row-desc {
    color: #64748B;
    font-size: 0.84rem;
}

.product-row-desc {
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-pill {
    color: #475569;
    background: #F1F5F9;
}

.status-pill.active {
    color: #047857;
    background: #DCFCE7;
}

.adminlte-product-page .card,
.adminlte-product-page .small-box {
    border-radius: 8px;
}

.adminlte-product-page .app-content-header,
.adminlte-product-page .app-content {
    width: 100%;
}

.adminlte-product-page .small-box {
    position: relative;
    overflow: hidden;
    min-height: 118px;
    padding: 18px;
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(15, 70, 153, 0.10);
}

.adminlte-product-page .small-box .inner h3 {
    margin: 0 0 8px;
    font-size: 2rem;
    font-weight: 900;
}

.adminlte-product-page .small-box .inner p {
    margin: 0;
    font-weight: 800;
}

.adminlte-product-page .small-box-icon {
    position: absolute;
    right: 18px;
    bottom: 12px;
    color: rgba(0, 0, 0, 0.16);
    font-size: 4rem;
}

.adminlte-product-page .text-bg-primary { background: #1D4ED8 !important; }
.adminlte-product-page .text-bg-success { background: #15803D !important; }
.adminlte-product-page .text-bg-warning { background: #F59E0B !important; color: #fff !important; }
.adminlte-product-page .text-bg-danger { background: #DC2626 !important; }

.adminlte-product-page .card {
    background: #fff;
    border: 1px solid #E6EEF9;
}

.adminlte-product-page .card-header {
    padding: 14px 16px;
    background: #fff;
    border-bottom: 1px solid #E6EEF9;
}

.adminlte-product-page .card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 900;
}

.adminlte-product-page .callout {
    padding: 10px 12px;
    border-left: 4px solid #1D4ED8;
    background: #F8FAFC;
    border-radius: 6px;
}

.adminlte-product-page .callout-warning {
    border-left-color: #F59E0B;
}

.product-filter-card,
.product-guide-card,
.product-list-card {
    box-shadow: 0 10px 30px rgba(15, 70, 153, 0.08);
}

.product-admin-table {
    min-width: 920px;
}

.product-table-item {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    max-width: 430px;
}

.product-thumb {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #1F66D8;
    background: #EEF5FF;
    border: 1px solid #E6EEF9;
    border-radius: 8px;
}

.product-thumb img,
.product-image-preview img,
.shopfront-detail-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-image-preview {
    position: relative;
    height: 360px;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #94A3B8;
    font-size: 2.5rem;
    background: #F8FAFC;
    border: 1px dashed #CBD5E1;
    border-radius: 8px;
}

.product-image-count {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 3px 8px;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    background: rgba(15, 23, 42, 0.72);
    border-radius: 999px;
}

.product-image-preview img {
    object-fit: contain;
}

.product-floating-alert {
    position: sticky;
    top: 0;
    z-index: 20;
}

.product-editor-modal .modal-content {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 48px);
    overflow: hidden;
}

.product-editor-modal form {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
}

.product-modal-dialog {
    width: min(1320px, calc(100vw - 32px));
    max-width: min(1320px, calc(100vw - 32px));
    margin-inline: auto;
}

.product-editor-modal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: calc(100vh - 170px);
    overflow-y: auto;
}

.product-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.38fr);
    gap: 22px;
}

.product-editor-main,
.product-editor-side {
    min-width: 0;
}

.product-form-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px 16px;
}

.product-field {
    grid-column: span 2;
    min-width: 0;
}

.product-field-wide {
    grid-column: span 4;
}

.product-field-full {
    grid-column: 1 / -1;
}

.product-field-compact {
    grid-column: span 2;
}

.product-image-field {
    padding: 12px;
    background: #F8FAFC;
    border: 1px solid #E5EEF9;
    border-radius: 10px;
}

.product-image-editor-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.42fr);
    gap: 12px;
    align-items: start;
}

.product-upload-panel {
    display: grid;
    gap: 8px;
}

.product-upload-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-top: 8px;
}

.product-rich-textarea {
    min-height: 340px !important;
    line-height: 1.6;
    resize: vertical;
}

.product-detail-textarea {
    min-height: 520px !important;
}

.product-editor-modal #productDescription {
    min-height: 340px !important;
}

.product-editor-modal #productDetailContent {
    min-height: 520px !important;
}

@media (max-width: 1040px) {
    .product-editor-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .product-modal-dialog {
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
        margin: 10px auto;
    }

    .product-editor-modal .modal-content {
        max-height: calc(100vh - 20px);
    }

    .product-form-grid {
        grid-template-columns: 1fr;
    }

    .product-field,
    .product-field-wide,
    .product-field-full,
    .product-field-compact {
        grid-column: 1 / -1;
    }

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

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

    .product-image-preview {
        height: 280px;
    }
}

.shopfront-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 18px;
    margin-bottom: 16px;
    padding: 26px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(15, 70, 153, 0.94), rgba(31, 102, 216, 0.86)),
        url("../images/fire-dashboard-hero-opt.webp") center/cover;
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(15, 70, 153, 0.18);
}

.shopfront-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 800;
    opacity: 0.9;
}

.shopfront-hero h2 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 900;
}

.shopfront-hero p {
    max-width: 620px;
    margin: 8px 0 0;
    color: rgba(255, 255, 255, 0.86);
}

.shopfront-summary {
    display: grid;
    grid-template-columns: repeat(2, 110px);
    gap: 10px;
}

.shopfront-summary div {
    padding: 12px;
    text-align: center;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
}

.shopfront-summary strong {
    display: block;
    font-size: 1.4rem;
    line-height: 1.1;
}

.shopfront-summary span {
    font-size: 0.82rem;
    opacity: 0.86;
}

.shopfront-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 16px;
}

.shopfront-filter,
.shopfront-main {
    background: #fff;
    border: 1px solid #E6EEF9;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(15, 70, 153, 0.08);
}

.shopfront-filter {
    align-self: start;
    padding: 16px;
}

.shopfront-filter-head h3,
.shopfront-toolbar h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 900;
}

.shopfront-filter-head {
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #E6EEF9;
}

.shopfront-main {
    min-width: 0;
    padding: 16px;
}

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

.shopfront-toolbar span {
    color: #64748B;
    font-size: 0.9rem;
}

.shopfront-status {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.shopfront-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}

.shopfront-card {
    overflow: hidden;
    border: 1px solid #E6EEF9;
    border-radius: 8px;
    background: #fff;
}

.shopfront-media {
    position: relative;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, #EEF5FF, #FFF7E6);
}

.shopfront-media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.shopfront-media-empty {
    height: 100%;
    display: grid;
    place-items: center;
    color: #1F66D8;
    font-size: 3rem;
}

.shopfront-category {
    position: absolute;
    left: 10px;
    top: 10px;
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    padding: 0 9px;
    color: #0F4699;
    font-size: 0.76rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(31, 102, 216, 0.18);
    border-radius: 999px;
}

.shopfront-card-body {
    padding: 13px;
}

.shopfront-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.shopfront-title-row h4 {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 900;
    line-height: 1.35;
}

.shopfront-card-body p {
    min-height: 42px;
    margin: 8px 0 12px;
    color: #64748B;
    font-size: 0.88rem;
}

.shopfront-spec-preview,
.shopfront-spec-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
}

.shopfront-spec-preview span,
.shopfront-spec-list div {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 4px 8px;
    color: #334155;
    font-size: 0.76rem;
    line-height: 1.3;
    background: #F6F9FE;
    border: 1px solid #E6EEF9;
    border-radius: 999px;
}

.shopfront-spec-list div {
    border-radius: 8px;
}

.shopfront-spec-list strong {
    color: #0F4699;
}

.shopfront-card-foot {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-end;
}

.shopfront-detail-media {
    height: 220px;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #1F66D8;
    font-size: 3rem;
    background: #EEF5FF;
    border-radius: 8px;
}

.shopfront-actions {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 8px;
    margin-top: 12px;
}

.shopfront-orders {
    padding-top: 2px;
    border-top: 1px solid #E6EEF9;
}

.shopfront-order-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #EEF3FA;
}

.shopfront-order-item:last-child {
    border-bottom: 0;
}

.shopfront-order-item strong,
.shopfront-order-item span,
.shopfront-order-item small {
    display: block;
}

.shopfront-order-item strong {
    overflow: hidden;
    color: #19324D;
    font-size: 0.88rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shopfront-order-item span {
    margin-top: 3px;
    color: #64748B;
    font-size: 0.76rem;
}

.shopfront-order-item small {
    margin-top: 4px;
    color: #475569;
    font-size: 0.76rem;
}

.shopfront-order-empty {
    padding: 16px 0 4px;
    color: #64748B;
    text-align: center;
}

.shop-checkout-section {
    margin-top: 14px;
    padding: 12px;
    background: #F8FBFF;
    border: 1px solid #E6EEF9;
    border-radius: 8px;
}

.shop-checkout-section h6 {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 10px;
    color: #19324D;
    font-weight: 900;
}

.shop-payment-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.shop-payment-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 10px;
    font-size: 0.88rem;
    background: #fff;
    border: 1px solid #D8E5F8;
    border-radius: 8px;
}

.shop-pay-summary {
    margin-top: 10px;
    color: #DC2626;
    font-size: 1rem;
    font-weight: 900;
}

.admin-orders-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
    gap: 14px;
    align-items: center;
    width: 100%;
}

.admin-orders-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 10px;
}

.admin-orders-table th,
.admin-orders-table td {
    vertical-align: middle;
}

.admin-order-status-select {
    min-width: 116px;
}

.admin-order-address {
    max-width: 260px;
}

.admin-order-note {
    max-width: 280px;
    margin-top: 4px;
    padding: 5px 7px;
    color: #334155;
    font-size: 0.78rem;
    line-height: 1.35;
    background: #FFF7ED;
    border: 1px solid #FED7AA;
    border-radius: 6px;
}

#orderModal .modal-dialog {
    height: auto;
    max-height: calc(100vh - 24px);
}

#orderModal .modal-content {
    max-height: calc(100vh - 24px);
}

#orderModal form {
    display: flex;
    min-height: 0;
    flex-direction: column;
}

#orderModal .modal-body {
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.shop-mall-page {
    display: grid;
    gap: 16px;
}

.shop-mall-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 24px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(15, 70, 153, 0.95), rgba(34, 122, 196, 0.86)),
        url("../images/fire-dashboard-hero-opt.webp") center/cover;
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(15, 70, 153, 0.18);
}

.shop-mall-head h2 {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 900;
}

.shop-mall-head p {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, 0.86);
}

.shop-order-drawer-btn {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.72);
}

.shop-order-drawer-btn:hover {
    color: #0F4699;
    background: #fff;
}

.shop-category-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 2px 0 8px;
}

.shop-category-chip {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 15px;
    color: #334155;
    font-weight: 800;
    background: #fff;
    border: 1px solid #D8E5F8;
    border-radius: 999px;
}

.shop-category-chip.active {
    color: #fff;
    background: #1D4ED8;
    border-color: #1D4ED8;
}

.shop-subcategory-strip {
    margin-top: -10px;
}

.shop-subcategory-strip .shop-category-chip {
    min-height: 32px;
    color: #475569;
    font-size: 0.8rem;
    background: #F8FAFC;
}

.shop-subcategory-strip .shop-category-chip.active {
    color: #fff;
    background: #0F766E;
    border-color: #0F766E;
}

.shop-search-bar {
    max-width: 720px;
}

.shop-mall-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
}

.shop-mall-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid #E6EEF9;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 70, 153, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.shop-mall-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(15, 70, 153, 0.13);
}

.shop-mall-media {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
    padding: 0;
    overflow: hidden;
    color: #1F66D8;
    font-size: 2.8rem;
    background: #F8FAFC;
    border: 0;
}

.shop-mall-media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.shop-mall-media em {
    position: absolute;
    left: 10px;
    top: 10px;
    padding: 3px 8px;
    color: #0F4699;
    font-size: 0.74rem;
    font-style: normal;
    font-weight: 900;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 999px;
}

.shop-mall-body {
    padding: 12px;
}

.shop-mall-title {
    width: 100%;
    padding: 0;
    color: #172033;
    text-align: left;
    font-weight: 900;
    line-height: 1.35;
    background: transparent;
    border: 0;
}

.shop-mall-desc {
    display: -webkit-box;
    min-height: 40px;
    margin-top: 7px;
    overflow: hidden;
    color: #64748B;
    font-size: 0.86rem;
    line-height: 1.45;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.shop-promo-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    margin-top: 8px;
    padding: 5px 9px;
    color: #B45309;
    font-size: 0.82rem;
    font-weight: 900;
    background: #FFF7ED;
    border: 1px solid #FED7AA;
    border-radius: 999px;
}

.shop-mall-foot,
.shop-detail-info {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.shop-detail-info {
    align-items: flex-start;
    flex-direction: column;
    margin-top: 14px;
}

.shop-detail-section-title {
    width: 100%;
    margin-top: 6px;
    padding-top: 12px;
    color: #172033;
    font-size: 1rem;
    font-weight: 900;
    border-top: 1px solid #E6EEF9;
}

.shop-promo-code {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
    margin: 0 0 8px;
    padding: 10px 12px;
    color: #334155;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
}

.shop-promo-code strong {
    color: #0F4699;
}

.shop-promo-code span {
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 800;
}

.taobao-open-tip {
    position: fixed;
    left: 50%;
    bottom: max(18px, calc(18px + var(--safe-area-bottom)));
    z-index: 2200;
    display: flex;
    align-items: center;
    gap: 8px;
    width: min(420px, calc(100vw - 28px));
    padding: 11px 13px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.45;
    background: rgba(15, 23, 42, 0.92);
    border-radius: 8px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.24);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 12px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.taobao-open-tip.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.shop-detail-carousel {
    background: #F8FAFC;
    border: 1px solid #E6EEF9;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.shop-detail-carousel .carousel-item {
    height: min(56vh, 460px);
}

.shop-detail-carousel .carousel-control-prev,
.shop-detail-carousel .carousel-control-next {
    width: 18%;
    opacity: 1;
    z-index: 3;
}

.shop-detail-carousel .carousel-control-prev-icon,
.shop-detail-carousel .carousel-control-next-icon {
    width: 2.25rem;
    height: 2.25rem;
    padding: 1.15rem;
    border-radius: 999px;
    background-color: rgba(15, 23, 42, 0.36);
    background-size: 1rem 1rem;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
}

.shop-detail-carousel .carousel-control-prev:hover .carousel-control-prev-icon,
.shop-detail-carousel .carousel-control-next:hover .carousel-control-next-icon {
    background-color: rgba(15, 23, 42, 0.52);
}

.shop-detail-carousel[data-has-multiple-images="false"] .shop-carousel-hint {
    display: none;
}

.shop-carousel-hint {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    background: rgba(15, 23, 42, 0.72);
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
    pointer-events: none;
    backdrop-filter: blur(6px);
}

.shop-carousel-hint i {
    font-size: 0.9rem;
    opacity: 0.95;
}

.shop-detail-carousel img,
.shop-detail-image-empty {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    object-fit: contain;
}

.shop-detail-image-empty {
    color: #1F66D8;
    font-size: 3rem;
}

.shop-markdown {
    width: 100%;
    color: #334155;
    line-height: 1.65;
}

.shop-markdown h3,
.shop-markdown h4,
.shop-markdown h5 {
    margin: 12px 0 8px;
    color: #172033;
    font-weight: 900;
}

.shop-markdown p,
.shop-markdown ul {
    margin: 0 0 10px;
}

.shop-markdown ul {
    padding-left: 1.2rem;
}

.shop-markdown code {
    padding: 2px 5px;
    color: #0F4699;
    background: #EEF5FF;
    border-radius: 4px;
}

.shop-detail-rich-image {
    width: 100%;
    max-height: 520px;
    margin: 10px 0 14px;
    display: block;
    object-fit: contain;
    background: #F8FAFC;
    border: 1px solid #E6EEF9;
    border-radius: 8px;
}

.shop-order-product {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.admin-order-actions {
    display: grid;
    gap: 8px;
    justify-items: end;
}

.admin-order-actions .form-select {
    min-width: 118px;
}

.shop-order-thumb {
    width: 86px;
    height: 86px;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #1F66D8;
    background: #F8FAFC;
    border: 1px solid #E6EEF9;
    border-radius: 8px;
}

.shop-order-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.shop-address-hint {
    margin: 0 0 10px;
    color: #64748B;
    font-size: 0.84rem;
}

.shop-wechat-qr-panel {
    align-items: center;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    min-height: 260px;
    padding: 18px;
}

.shop-wechat-qr-link {
    display: block;
    width: min(100%, 300px);
}

.shop-wechat-qr-panel img {
    aspect-ratio: 1;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
    max-width: 100%;
    object-fit: cover;
    width: 100%;
}

.shop-wechat-qr-fallback {
    align-items: center;
    color: #475569;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
}

.shop-wechat-qr-fallback i {
    color: #16A34A;
    font-size: 3rem;
}

.shop-wechat-qr-fallback span {
    color: #64748B;
    font-size: 0.9rem;
}

.shop-qr-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.shop-qr-actions .btn {
    min-width: 128px;
}

@media (max-width: 430px) {
    .shop-qr-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .shop-qr-actions .btn {
        width: 100%;
    }
}

.shop-spec-choice + .shop-spec-choice {
    margin-top: 12px;
}

.shop-spec-choice-title {
    margin-bottom: 8px;
    color: #334155;
    font-weight: 900;
}

.shop-spec-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.shop-spec-options label {
    cursor: pointer;
}

.shop-spec-options input {
    position: absolute;
    opacity: 0;
}

.shop-spec-options span {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    padding: 0 12px;
    color: #334155;
    font-weight: 800;
    background: #fff;
    border: 1px solid #D8E5F8;
    border-radius: 8px;
}

.shop-spec-options input:checked + span {
    color: #fff;
    background: #1D4ED8;
    border-color: #1D4ED8;
}

@media (max-width: 768px) {
    .shop-filter-bar,
    .product-admin-filters {
        grid-template-columns: 1fr;
    }

    .shop-grid {
        grid-template-columns: 1fr;
    }

    .shop-product-body p {
        min-height: auto;
    }

    .shopfront-hero,
    .shopfront-layout {
        grid-template-columns: 1fr;
    }

    .shopfront-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .shopfront-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .shopfront-grid {
        grid-template-columns: 1fr;
    }

    .shop-payment-options {
        grid-template-columns: 1fr;
    }

    .admin-orders-toolbar,
    .admin-orders-filters {
        grid-template-columns: 1fr;
    }

    .admin-order-actions {
        justify-items: stretch;
    }

    .admin-order-actions .form-select,
    .admin-order-actions .btn {
        width: 100%;
    }

    .shop-mall-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .shop-mall-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .shop-mall-body {
        padding: 14px;
    }

    .shop-mall-card {
        width: 100%;
    }

    .shop-mall-media {
        aspect-ratio: 4 / 3;
    }

    .shop-mall-media em {
        max-width: calc(100% - 20px);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .shop-mall-title {
        font-size: 1.02rem;
        line-height: 1.45;
    }

    .shop-mall-desc {
        min-height: auto;
        max-height: 3.1em;
        -webkit-line-clamp: 2;
        word-break: break-word;
    }

    .shopfront-spec-preview {
        max-height: 34px;
        overflow: hidden;
        margin-top: 10px;
        margin-bottom: 12px;
    }

    .shopfront-spec-preview span {
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .shop-mall-foot {
        align-items: flex-end;
    }

    .shop-detail-carousel .carousel-item {
        height: min(48vh, 360px);
    }

    .shop-carousel-hint {
        bottom: 10px;
        padding: 5px 10px;
        font-size: 0.72rem;
    }

    .shop-detail-carousel .carousel-control-prev-icon,
    .shop-detail-carousel .carousel-control-next-icon {
        width: 2rem;
        height: 2rem;
        padding: 1rem;
    }
}

.modal-backdrop {
    z-index: 1050 !important;
}

.modal {
    z-index: 1060 !important;
}

.modal.show {
    display: block;
}

@media (max-width: 430px) {
    .analytics-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .analytics-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: 14px 12px;
        overflow: hidden;
    }

    .analytics-head {
        max-width: 100%;
        min-width: 0;
    }

    .chart-box {
        width: 100% !important;
        max-width: 100%;
        min-width: 0;
        height: 190px;
        overflow: hidden;
    }

    .chart-box > div,
    .chart-box canvas {
        max-width: 100% !important;
    }

    .metric-grid,
    .salary-mini-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .toolbar-title {
        min-width: 118px;
    }

    .toolbar-actions {
        min-width: 392px;
    }

    .hero-copy {
        max-width: 80%;
    }

    .salary-record-summary {
        gap: 8px;
    }

    .salary-record-amounts {
        gap: 7px;
    }

    .collapse-arrow {
        flex: 0 0 auto;
    }
}

@media (min-width: 431px) and (max-width: 760px) {
    #salaryCompositionChart {
        height: 250px;
    }
}

@media (max-width: 768px) {
    .app-sidebar {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        max-width: none !important;
        box-sizing: border-box;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        padding: 8px 8px calc(8px + var(--safe-area-bottom)) !important;
        border-right: 0 !important;
        border-top: 1px solid #DFE9F7;
        border-radius: 0;
    }

    .app-main {
        padding-bottom: calc(108px + var(--safe-area-bottom)) !important;
    }

    /* 管理页工具栏标题在手机端允许换行，避免被省略号截断 */
    .toolbar-panel {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .toolbar-title {
        min-width: 0 !important;
        width: 100%;
    }

    .toolbar-title h3,
    .toolbar-title span {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .toolbar-actions {
        min-width: 0 !important;
        width: 100%;
        justify-content: start;
    }
}

#profileModal .detail-item,
.profile-page .detail-item {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    justify-content: start;
    column-gap: 18px;
    align-items: center;
}

#profileModal .detail-label,
.profile-page .detail-label {
    white-space: nowrap;
    min-width: max-content;
}

#profileModal .detail-value,
.profile-page .detail-value {
    min-width: 0;
    text-align: left;
    overflow-wrap: anywhere;
}

.profile-page {
    max-width: 760px;
    margin: 0 auto;
}

.profile-page-card {
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

.profile-page-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.profile-password-form {
    border-top: 1px solid #E5E7EB;
    padding-top: 16px;
}

@media (max-width: 430px) {
    .profile-page-card {
        padding: 14px;
    }

    .profile-page-actions {
        grid-template-columns: 1fr;
    }
}

.backup-choice-panel {
    padding: 14px 16px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
}

/* Mobile-first polish for the user salary pages. Keep this late so it wins over
   older responsive patches above. */
@media (max-width: 768px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .app-shell {
        width: 100%;
        min-height: 100dvh;
        border: 0;
        border-radius: 0;
    }

    .app-topbar {
        position: sticky;
        top: 0;
        z-index: 1030;
        min-height: 62px !important;
        padding: 9px 12px !important;
        flex-wrap: nowrap;
        gap: 8px;
    }

    .brand-lockup {
        min-width: 0;
        gap: 8px;
    }

    .brand-emblem {
        width: 36px !important;
        height: 36px !important;
        flex: 0 0 36px;
    }

    .brand-lockup strong {
        max-width: 46vw;
        font-size: 0.94rem !important;
        line-height: 1.15;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .brand-lockup small {
        font-size: 0.72rem !important;
        line-height: 1.15;
    }

    .topbar-motto,
    .topbar-icon,
    .topbar-actions .logout-link {
        display: none !important;
    }

    .topbar-actions .user-chip {
        margin-right: 0;
    }

    .topbar-actions {
        margin-left: auto;
        flex: 0 0 auto;
    }

    .user-chip {
        width: 36px;
        height: 36px;
        padding: 0 !important;
        justify-content: center;
        border-radius: 50%;
        font-size: 0 !important;
    }

    .user-chip i {
        margin: 0;
        font-size: 1.2rem !important;
    }

    .app-main {
        width: 100%;
        max-width: 100%;
        padding: 12px max(12px, env(safe-area-inset-left)) calc(84px + var(--safe-area-bottom)) max(12px, env(safe-area-inset-right)) !important;
        overflow-x: hidden;
    }

    .app-sidebar {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        align-items: stretch;
        gap: 4px !important;
        overflow: hidden !important;
    }

    .side-link {
        flex: initial;
        min-width: 0;
        min-height: 52px !important;
        padding: 5px 4px !important;
        border-radius: 8px !important;
        font-size: 0.72rem !important;
        line-height: 1.1;
    }

    .side-link i {
        font-size: 1.08rem;
    }

    .side-link span {
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .dashboard-hero.fire-hero,
    .dashboard-hero.fire-hero.compact-hero,
    .user-hero {
        min-height: auto !important;
        padding: 16px !important;
        border-radius: 10px !important;
        background-position: center !important;
    }

    .user-hero .hero-copy,
    .compact-hero .hero-copy,
    .hero-copy {
        max-width: 100% !important;
        padding-right: 42px;
    }

    .hero-kicker {
        font-size: 0.72rem !important;
    }

    .hero-copy h2 {
        margin-top: 6px;
        font-size: 1.22rem !important;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .hero-copy p {
        margin-top: 6px;
        font-size: 0.84rem !important;
        line-height: 1.45;
    }

    .hero-status-strip {
        margin-top: 12px;
        gap: 6px;
    }

    .hero-status-strip span {
        min-height: 28px;
        padding: 5px 8px;
        font-size: 0.76rem !important;
    }

    .hero-logout-btn {
        top: 10px;
        right: 10px;
        width: 34px;
        height: 34px;
        padding: 0;
        justify-content: center;
        gap: 0;
        font-size: 0;
    }

    .hero-logout-btn i {
        font-size: 1rem;
    }

    .salary-overview-panel {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        padding: 14px !important;
        border-radius: 10px !important;
    }

    .salary-primary {
        min-width: 0;
    }

    .salary-primary-value {
        font-size: clamp(1.7rem, 10vw, 2.35rem) !important;
        line-height: 1.08;
        overflow-wrap: anywhere;
    }

    .salary-mini-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    .salary-mini-item {
        min-width: 0;
        padding: 10px !important;
        border-radius: 8px !important;
    }

    .salary-mini-item span {
        font-size: 0.72rem !important;
    }

    .salary-mini-item strong {
        font-size: 0.94rem !important;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .analytics-grid,
    .dashboard-shortcut-row {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .analytics-card {
        padding: 13px !important;
        border-radius: 10px !important;
    }

    .analytics-head {
        gap: 8px;
        align-items: flex-start;
    }

    .analytics-head h5 {
        font-size: 0.98rem;
    }

    .chart-box {
        height: clamp(188px, 52vw, 240px) !important;
    }

    .shortcut-card {
        min-width: 0;
        grid-template-columns: 38px minmax(0, 1fr) 18px !important;
        padding: 12px !important;
        border-radius: 10px !important;
    }

    .shortcut-icon {
        width: 38px !important;
        height: 38px !important;
    }

    .section-title-row {
        align-items: flex-start;
        gap: 4px;
    }

    .salary-record-card {
        border-radius: 10px !important;
    }

    .salary-record-head {
        padding: 12px !important;
    }

    .salary-record-summary {
        gap: 10px !important;
    }

    .salary-record-amounts {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
        align-items: center;
    }

    .salary-record-amounts small,
    .salary-record-amounts span {
        white-space: nowrap;
    }

    .salary-record-body {
        padding: 10px !important;
    }

    .salary-detail-section {
        padding: 12px !important;
        border-radius: 10px !important;
    }

    .detail-line {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
    }

    .detail-line span,
    .detail-line strong {
        font-size: 0.84rem !important;
    }

    .toolbar-panel {
        padding: 14px !important;
        border-radius: 10px !important;
    }

    .toolbar-title {
        margin-bottom: 10px;
    }

    .toolbar-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 8px !important;
        overflow: visible !important;
    }

    .toolbar-actions .btn {
        width: 100%;
        min-width: 0;
        white-space: nowrap;
        padding: 0.7rem 0.6rem;
        font-size: 0.82rem;
    }

    .admin-filter-row {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px !important;
        align-items: stretch;
        min-width: 0 !important;
    }

    .admin-filter-row .filter-field,
    .admin-filter-row .month-filter-wrap,
    .admin-filter-row .filter-search-main {
        width: 100%;
        min-width: 0;
    }

    .admin-filter-row .filter-search-main {
        grid-column: 1 / -1;
    }

    .admin-filter-row .input-group,
    .admin-filter-row .form-control,
    .admin-filter-row .form-select {
        width: 100%;
        min-width: 0;
        height: 38px;
        min-height: 38px;
        font-size: 0.8rem;
    }

    .admin-filter-row .filter-label {
        margin-bottom: 4px;
        font-size: 0.72rem;
    }

    .admin-filter-row .input-group-text {
        min-height: 38px;
        padding: 0 10px;
    }

    .admin-filter-row .filter-submit-btn,
    .admin-filter-row .filter-reset-btn {
        width: 100%;
        min-height: 38px;
        padding: 0.45rem 0.5rem;
        font-size: 0.78rem;
    }

    .month-filter-icon {
        left: 10px;
        top: calc(50% + 11px);
    }

    .month-filter-wrap .form-select {
        padding-left: 32px;
    }
}

@media (max-width: 390px) {
    .brand-lockup strong {
        max-width: 40vw;
    }

    .salary-record-amounts {
        grid-template-columns: 1fr auto !important;
    }

    .salary-record-amounts .text-end {
        text-align: left !important;
    }

    .salary-record-amounts .text-end:nth-child(2) {
        grid-column: 1 / 2;
    }

    .collapse-arrow {
        grid-column: 2;
        grid-row: 1 / 3;
    }
}

/* Keep product editing usable on phones. This stays late in the file so it wins
   over older modal and admin-page responsive rules above. */
@media (max-width: 768px) {
    .product-editor-modal {
        padding: 0 !important;
    }

    .product-modal-dialog {
        width: 100% !important;
        max-width: 100% !important;
        height: 100dvh;
        margin: 0 !important;
    }

    .product-editor-modal .modal-content {
        height: 100dvh;
        max-height: 100dvh !important;
        border: 0;
        border-radius: 0;
    }

    .product-editor-modal form {
        height: 100%;
    }

    .product-editor-modal .modal-header {
        flex: 0 0 auto;
        padding: 12px 14px;
    }

    .product-editor-modal .modal-body {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none !important;
        padding: 12px 12px 18px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .product-editor-modal .modal-footer {
        position: sticky;
        bottom: 0;
        z-index: 5;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        flex: 0 0 auto;
        padding: 10px 12px calc(10px + var(--safe-area-bottom));
        background: #fff;
        border-top: 1px solid #DDE7F3;
        box-shadow: 0 -12px 24px rgba(15, 23, 42, 0.08);
    }

    .product-editor-modal .modal-footer .btn {
        width: 100%;
        min-height: 42px;
    }

    .product-editor-grid,
    .product-form-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    .product-field,
    .product-field-wide,
    .product-field-full,
    .product-field-compact {
        grid-column: 1 / -1 !important;
    }

    .product-editor-main,
    .product-editor-side {
        min-width: 0;
    }

    .product-editor-side {
        order: 2;
    }

    .product-upload-row {
        grid-template-columns: 1fr !important;
    }

    .product-image-editor-row {
        grid-template-columns: 1fr !important;
    }

    .product-image-field {
        padding: 10px;
    }

    .product-editor-modal textarea.form-control {
        min-height: 118px;
        overflow: auto;
        resize: vertical;
        line-height: 1.55;
    }

    #productImageUrls {
        min-height: 126px;
    }

    #productDescription {
        min-height: 170px;
    }

    #productDetailContent {
        min-height: 240px;
    }

    #productSpecOptions {
        min-height: 138px;
    }

    .product-editor-modal .card {
        margin-bottom: 12px;
        border-radius: 10px;
    }

    .product-editor-modal .card-body {
        padding: 12px;
    }
}

@media (max-width: 430px) {
    .product-editor-modal .modal-title {
        font-size: 1rem;
    }

    .product-editor-modal .form-label {
        margin-bottom: 5px;
        font-size: 0.9rem;
    }

    .product-editor-modal .form-text {
        font-size: 0.78rem;
        line-height: 1.45;
    }
}

/* Final mobile product-management pass after visual checks. */
@media (max-width: 768px) {
    .adminlte-product-page .app-content-header .row {
        gap: 12px !important;
    }

    .adminlte-product-page .app-content-header h2 {
        font-size: clamp(1.7rem, 9vw, 2.35rem);
        line-height: 1.08;
    }

    .adminlte-product-page .app-content-header .text-secondary {
        font-size: 0.95rem;
        line-height: 1.55;
    }

    .adminlte-product-page .app-content-header .d-flex {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 8px !important;
        width: 100%;
    }

    .adminlte-product-page .app-content-header .btn {
        width: 100%;
        min-width: 0;
        justify-content: center;
        padding: 0.72rem 0.55rem;
        white-space: nowrap;
    }

    .adminlte-product-page .app-content-header #openProductModalBtn {
        grid-column: 1 / -1;
    }

    .adminlte-product-page .small-box {
        min-height: 102px;
        padding: 14px 12px;
    }

    .adminlte-product-page .small-box .inner h3 {
        font-size: 1.72rem;
    }

    .adminlte-product-page .small-box-icon {
        right: 12px;
        bottom: 10px;
        font-size: 3.2rem;
    }

    .adminlte-product-page .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .product-admin-table {
        min-width: 820px;
    }

    .product-table-item {
        max-width: 360px;
    }

    .product-table-item .text-truncate {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        overflow-wrap: anywhere;
    }

    .product-editor-modal .modal-header {
        min-height: 72px;
        padding: 13px 14px;
        background: #fff;
    }

    .product-editor-modal .modal-header .text-secondary {
        margin-top: 3px;
        line-height: 1.35;
    }

    .product-editor-modal .modal-body {
        padding: 14px 12px calc(92px + var(--safe-area-bottom)) !important;
        background: #F6F9FD;
    }

    .product-editor-modal .card {
        overflow: hidden;
        box-shadow: 0 8px 22px rgba(15, 70, 153, 0.06);
    }

    .product-editor-modal .card-header {
        padding: 12px 14px;
    }

    .product-editor-modal .card-body {
        padding: 14px !important;
    }

    .product-editor-modal .form-control,
    .product-editor-modal .form-select {
        min-height: 46px;
        border-radius: 8px;
        font-size: 0.98rem;
    }

    .product-editor-modal textarea.form-control {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .product-editor-modal #productImageUrls {
        min-height: 150px !important;
    }

    .product-editor-modal #productDescription {
        min-height: 260px !important;
    }

    .product-editor-modal #productDetailContent {
        min-height: 360px !important;
    }

    .product-editor-modal #productSpecOptions {
        min-height: 170px !important;
    }

    .product-image-preview {
        height: min(58vh, 380px) !important;
    }

    .product-image-preview img {
        object-fit: contain;
    }

    .product-editor-modal .modal-footer {
        position: fixed !important;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1070;
    }
}

@media (max-width: 390px) {
    .adminlte-product-page .app-content-header .btn {
        font-size: 0.86rem;
    }

    .adminlte-product-page .small-box {
        min-height: 94px;
    }

    .product-editor-modal #productDescription {
        min-height: 240px !important;
    }

    .product-editor-modal #productDetailContent {
        min-height: 330px !important;
    }
}

/* Bottom navigation alignment: keep icon and label centered as one vertical tab. */
@media (max-width: 768px) {
    .app-main {
        padding-bottom: calc(116px + var(--safe-area-bottom)) !important;
    }

    .app-sidebar {
        min-height: calc(72px + var(--safe-area-bottom));
    }

    .app-sidebar .side-link,
    .app-sidebar .side-button {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 5px !important;
        text-align: center !important;
    }

    .app-sidebar .side-link i,
    .app-sidebar .side-button i {
        display: block !important;
        width: 24px;
        height: 24px;
        margin: 0 !important;
        line-height: 24px !important;
        text-align: center !important;
    }

    .app-sidebar .side-link span,
    .app-sidebar .side-button span {
        display: block !important;
        width: 100%;
        margin: 0 !important;
        line-height: 1.1 !important;
        text-align: center !important;
    }

    .salary-overview-panel {
        gap: 8px !important;
    }

    .salary-mini-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    .salary-mini-item {
        min-height: 74px !important;
        padding: 10px 12px !important;
        align-content: center;
    }

    .salary-mini-item span {
        margin-bottom: 5px;
        font-size: 0.78rem !important;
    }

    .salary-mini-item strong {
        font-size: clamp(0.92rem, 4.2vw, 1.12rem) !important;
        line-height: 1.18 !important;
    }
}

/* Product images must show the uploaded picture completely without stretching. */
.shop-mall-media,
.shop-detail-carousel,
.shop-detail-carousel .carousel-item,
.product-thumb,
.product-image-preview,
.shop-order-thumb,
.shop-detail-rich-image {
    background: #F8FAFC;
}

.shop-mall-media img,
.shop-detail-carousel img,
.product-thumb img,
.product-image-preview img,
.shop-order-thumb img,
.shop-detail-rich-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
}

.product-thumb img,
.shop-order-thumb img {
    padding: 2px;
}

.shop-detail-rich-image {
    height: auto !important;
    max-height: none;
}

/* Product list covers use a fixed preview box and fit the whole uploaded image
   inside it. This avoids both stretching and overly tall product cards. */
.shop-mall-card .shop-mall-media {
    aspect-ratio: auto !important;
    min-height: 0 !important;
    height: clamp(220px, 58vw, 360px) !important;
    padding: 8px !important;
    background: #F8FAFC;
}

.shop-mall-card .shop-mall-media img {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    display: block !important;
    object-fit: contain !important;
}

.shop-mall-card .shop-mall-media:not(:has(img)) {
    place-items: center !important;
}

@media (max-width: 430px) {
    .shop-mall-card .shop-mall-media {
        height: clamp(210px, 62vw, 280px) !important;
    }
}

/* AI chat is a full-screen tool on phones: keep it inside the viewport and
   avoid the bottom navigation competing with the message composer. */
@media (max-width: 768px) {
    body.ai-chat-page .app-sidebar {
        display: none !important;
    }

    body.ai-chat-page .app-body {
        display: block !important;
        min-height: 0 !important;
    }

    body.ai-chat-page .app-main {
        min-width: 0 !important;
        min-height: 0 !important;
        height: calc(100dvh - 76px - var(--safe-area-bottom)) !important;
        padding: 8px max(8px, env(safe-area-inset-left)) calc(8px + var(--safe-area-bottom)) max(8px, env(safe-area-inset-right)) !important;
        overflow: hidden !important;
    }

    body.ai-chat-page .ai-immersive-shell {
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    body.ai-chat-page .ai-chat-panel {
        width: 100% !important;
        height: 100% !important;
        min-width: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        padding: 10px !important;
        overflow: hidden !important;
    }

    body.ai-chat-page .ai-chat-head {
        flex: 0 0 auto !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }

    body.ai-chat-page .ai-chat-head form {
        flex: 0 0 auto !important;
    }

    body.ai-chat-page .ai-message-list {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

    body.ai-chat-page .ai-message-bubble {
        max-width: 88% !important;
        overflow-wrap: anywhere !important;
    }

    body.ai-chat-page .ai-chat-form {
        flex: 0 0 auto !important;
    }

    body.ai-chat-page .ai-input-row {
        grid-template-columns: 38px minmax(0, 1fr) 38px 44px !important;
        align-items: stretch !important;
        gap: 6px !important;
    }

    body.ai-chat-page .ai-input-row .btn {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 48px !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        line-height: 1 !important;
    }

    body.ai-chat-page .ai-input-row .btn i {
        margin: 0 !important;
        font-size: 1.18rem !important;
        line-height: 1 !important;
    }

    body.ai-chat-page .ai-chat-form textarea {
        min-width: 0 !important;
        min-height: 48px !important;
        max-height: 84px !important;
        resize: none !important;
    }
}

/* AI chat composer: textarea grows with content up to a fixed cap, then scrolls.
   The attachment sheet opens below the composer with three large choices. */
.ai-chat-form {
    --ai-input-max-height: 132px;
}

.ai-chat-form textarea {
    overflow-y: hidden;
}

.ai-attach-sheet {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.ai-attach-choice {
    min-height: 96px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    color: #172033;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    background: #F8FBFF;
    border: 1px solid #DCE9F8;
    border-radius: 8px;
}

.ai-attach-choice i {
    font-size: 1.65rem;
}

.ai-attach-choice:hover {
    color: #0F4699;
    border-color: #AFCBF5;
    background: #EFF6FF;
}

@media (max-width: 768px) {
    body.ai-chat-page {
        background: #0F1012 !important;
    }

    body.ai-chat-page .app-topbar,
    body.ai-chat-page .app-sidebar {
        display: none !important;
    }

    body.ai-chat-page .app-shell,
    body.ai-chat-page .app-body {
        min-height: 100dvh !important;
        background: #0F1012 !important;
    }

    body.ai-chat-page .app-main {
        height: 100dvh !important;
        padding: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) calc(14px + var(--safe-area-bottom)) max(14px, env(safe-area-inset-left)) !important;
        background: #0F1012 !important;
    }

    body.ai-chat-page .ai-chat-panel {
        padding: 0 !important;
        color: #F5F7FA !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    body.ai-chat-page .ai-chat-head {
        position: relative;
        min-height: 60px;
        display: grid !important;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        align-items: start !important;
        gap: 8px !important;
        margin: 0 0 10px !important;
    }

    body.ai-chat-page .ai-chat-head > div {
        grid-column: 1 / -1;
        text-align: center;
        padding: 0 52px;
    }

    body.ai-chat-page .ai-back-link {
        position: absolute;
        left: 0;
        top: 2px;
        width: 42px;
        height: 42px;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        margin: 0 !important;
        color: #F5F7FA !important;
        font-size: 0 !important;
        border-radius: 999px;
    }

    body.ai-chat-page .ai-back-link i {
        font-size: 1.6rem;
    }

    body.ai-chat-page .ai-chat-head h3 {
        margin: 2px 0 4px !important;
        color: #F8FAFC !important;
        font-size: 1.1rem !important;
        font-weight: 900 !important;
    }

    body.ai-chat-page .ai-chat-head span {
        display: block !important;
        color: #8E949E !important;
        font-size: 0.78rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body.ai-chat-page .ai-chat-head form {
        position: absolute;
        right: 0;
        top: 4px;
        margin: 0;
    }

    body.ai-chat-page .ai-chat-head .btn {
        width: 38px;
        height: 38px;
        min-height: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0 !important;
        color: #F5F7FA !important;
        font-size: 0 !important;
        background: transparent !important;
        border: 0 !important;
    }

    body.ai-chat-page .ai-chat-head .btn i {
        font-size: 1.28rem;
    }

    body.ai-chat-page .ai-message-list {
        padding: 10px 0 14px !important;
        background: transparent !important;
        border: 0 !important;
        border-radius: 0 !important;
    }

    body.ai-chat-page .ai-message {
        margin-bottom: 14px !important;
    }

    body.ai-chat-page .ai-message-bubble {
        max-width: 82% !important;
        padding: 11px 13px !important;
        color: #E7E9EE !important;
        background: #222326 !important;
        border: 1px solid #303236 !important;
        border-radius: 20px 20px 20px 6px !important;
        font-size: 0.96rem !important;
        box-shadow: none !important;
    }

    body.ai-chat-page .ai-message.user .ai-message-bubble {
        color: #fff !important;
        background: #2F6FEB !important;
        border-color: #2F6FEB !important;
        border-radius: 20px 20px 6px 20px !important;
    }

    body.ai-chat-page .ai-message-bubble span {
        color: inherit !important;
        opacity: 0.62;
    }

    body.ai-chat-page .ai-message-bubble p {
        line-height: 1.65 !important;
    }

    body.ai-chat-page .ai-message.assistant .ai-markdown-table-wrap {
        margin: 0.25em 0 0.65em;
        border-radius: 8px;
    }

    body.ai-chat-page .ai-message.assistant .ai-markdown-table {
        min-width: 100%;
        width: max-content;
        font-size: 0.82rem;
    }

    body.ai-chat-page .ai-message.assistant .ai-markdown-table th,
    body.ai-chat-page .ai-message.assistant .ai-markdown-table td {
        padding: 6px 8px;
        word-break: keep-all;
        white-space: nowrap;
    }

    body.ai-chat-page .ai-empty-chat,
    body.ai-chat-page .ai-unavailable {
        color: #8E949E !important;
        background: transparent !important;
    }

    body.ai-chat-page .ai-empty-chat strong,
    body.ai-chat-page .ai-unavailable strong {
        color: #F8FAFC !important;
    }

    body.ai-chat-page .ai-chat-form {
        --ai-input-max-height: 118px;
        padding: 12px;
        gap: 8px !important;
        background: #232427;
        border: 1px solid #35373C;
        border-radius: 24px;
        box-shadow: 0 16px 34px rgba(0, 0, 0, 0.35);
    }

    body.ai-chat-page .ai-input-row {
        grid-template-columns: 38px minmax(0, 1fr) 38px 42px !important;
        gap: 8px !important;
        align-items: end !important;
    }

    body.ai-chat-page .ai-chat-form textarea {
        min-height: 42px !important;
        max-height: var(--ai-input-max-height) !important;
        padding: 8px 2px !important;
        color: #F8FAFC !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        line-height: 1.55 !important;
    }

    body.ai-chat-page .ai-chat-form textarea::placeholder {
        color: #A1A7B0 !important;
    }

    body.ai-chat-page .ai-input-row .btn {
        min-height: 42px !important;
        height: 42px !important;
        color: #F5F7FA !important;
        background: transparent !important;
        border: 0 !important;
        border-radius: 999px !important;
    }

    body.ai-chat-page .ai-input-row .btn-primary {
        color: #fff !important;
        background: #4F7DFF !important;
    }

    body.ai-chat-page .ai-input-row .btn-outline-primary {
        color: #75A7FF !important;
    }

    body.ai-chat-page .ai-attach-preview span {
        color: #DCE3EE !important;
        background: #30333A !important;
        border-color: #444854 !important;
    }

    body.ai-chat-page .ai-attach-sheet {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        margin-top: 12px;
    }

    body.ai-chat-page .ai-attach-choice {
        min-height: 94px;
        color: #F8FAFC;
        background: #3A3B3E;
        border: 1px solid #45474C;
        border-radius: 16px;
    }

    body.ai-chat-page .ai-attach-choice i {
        font-size: 1.75rem;
    }
}

/* Chat composer: full-width input with a smaller button row underneath. */
.ai-chat-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-message-input {
    width: 100%;
    min-height: 88px;
    resize: none;
    line-height: 1.6;
}

.ai-action-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.ai-action-row .btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.ai-action-row .btn i {
    font-size: 1rem;
    line-height: 1;
}

.ai-action-row .btn-primary {
    width: 38px;
    min-width: 38px;
}

.ai-chat-form .ai-attach-preview {
    margin-bottom: -2px;
}

@media (max-width: 768px) {
    body.ai-chat-page {
        background: #F5F7FB !important;
    }

    body.ai-chat-page .app-shell,
    body.ai-chat-page .app-body,
    body.ai-chat-page .app-main {
        background: #F5F7FB !important;
    }

    body.ai-chat-page .ai-chat-panel {
        padding: 12px !important;
        color: #172033 !important;
        background: #fff !important;
        border: 1px solid #E6EEF9 !important;
        box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08) !important;
    }

    body.ai-chat-page .ai-chat-head {
        position: relative;
        min-height: 56px;
        display: grid !important;
        grid-template-columns: 40px minmax(0, 1fr) 40px;
        align-items: start !important;
        gap: 8px !important;
        margin: 0 0 10px !important;
    }

    body.ai-chat-page .ai-chat-head > div {
        grid-column: 1 / -1;
        text-align: center;
        padding: 0 46px;
    }

    body.ai-chat-page .ai-back-link {
        position: absolute;
        left: 0;
        top: 2px;
        width: 40px;
        height: 40px;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        margin: 0 !important;
        color: #1F66D8 !important;
        font-size: 0 !important;
        border-radius: 999px;
    }

    body.ai-chat-page .ai-back-link i {
        font-size: 1.35rem;
    }

    body.ai-chat-page .ai-chat-head h3 {
        margin: 2px 0 4px !important;
        color: #172033 !important;
        font-size: 1.04rem !important;
        font-weight: 900 !important;
    }

    body.ai-chat-page .ai-chat-head span {
        display: block !important;
        color: #64748B !important;
        font-size: 0.78rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body.ai-chat-page .ai-chat-head form {
        position: absolute;
        right: 0;
        top: 4px;
        margin: 0;
    }

    body.ai-chat-page .ai-chat-head .btn {
        width: 36px;
        height: 36px;
        min-height: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0 !important;
        color: #D14343 !important;
        font-size: 0 !important;
        background: transparent !important;
        border: 0 !important;
    }

    body.ai-chat-page .ai-chat-head .btn i {
        font-size: 1.18rem;
    }

    body.ai-chat-page .ai-message-list {
        background: #F8FBFF !important;
        border: 1px solid #E6EEF9 !important;
        border-radius: 10px !important;
    }

    body.ai-chat-page .ai-message-bubble {
        color: #172033 !important;
        background: #fff !important;
        border-color: #E6EEF9 !important;
    }

    body.ai-chat-page .ai-message.user .ai-message-bubble {
        color: #fff !important;
        background: #1F66D8 !important;
        border-color: #1F66D8 !important;
    }

    body.ai-chat-page .ai-empty-chat,
    body.ai-chat-page .ai-unavailable {
        color: #64748B !important;
        background: transparent !important;
    }

    body.ai-chat-page .ai-empty-chat strong,
    body.ai-chat-page .ai-unavailable strong {
        color: #172033 !important;
    }

    body.ai-chat-page .ai-chat-form {
        position: sticky;
        bottom: 0;
        z-index: 5;
        padding: 12px !important;
        background: #fff !important;
        border: 1px solid #E6EEF9;
        border-radius: 12px;
        box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.06);
    }

    body.ai-chat-page .ai-message-input {
        min-height: 92px;
        max-height: 150px;
        font-size: 0.96rem;
        color: #172033 !important;
        -webkit-text-fill-color: #172033 !important;
        caret-color: #172033 !important;
        background: #fff !important;
        border: 1px solid #DCE9F8 !important;
        box-shadow: none !important;
        padding: 10px 12px !important;
    }

    body.ai-chat-page .ai-message-input::placeholder {
        color: #94A3B8 !important;
    }

    body.ai-chat-page .ai-action-row .btn {
        width: 34px;
        height: 34px;
        min-width: 34px;
        min-height: 34px;
        border-radius: 8px;
    }

    body.ai-chat-page .ai-action-row .btn-primary {
        width: 36px;
        min-width: 36px;
    }

    body.ai-chat-page .ai-attach-sheet {
        gap: 8px;
        margin-top: 8px;
    }

    body.ai-chat-page .ai-attach-choice {
        min-height: 82px;
        color: #172033 !important;
        background: #F8FBFF;
        border-color: #DCE9F8;
    }

    body.ai-chat-page .ai-attach-choice i,
    body.ai-chat-page .ai-attach-choice span {
        color: #172033 !important;
    }

    body.ai-chat-page .ai-attach-choice:hover,
    body.ai-chat-page .ai-attach-choice:active {
        color: #0F4699 !important;
        background: #EFF6FF !important;
        border-color: #AFCBF5 !important;
    }
}

/* Final desktop login guard: keep the login form card constrained on wide
   browsers even if older experimental rules or :has() support differ. */
@media (min-width: 769px) {
    body.login-page {
        width: 100vw !important;
        height: 100vh !important;
        min-height: 100vh !important;
        margin: 0 !important;
        overflow: hidden !important;
        background: #0B1D3A !important;
    }

    body.login-page main.login-main {
        width: 100vw !important;
        height: 100vh !important;
        min-height: 100vh !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
        overflow: hidden !important;
    }

    body.login-page .login-v2 {
        width: 100vw !important;
        height: 100vh !important;
        min-height: 100vh !important;
        display: grid !important;
        place-items: center !important;
        padding: clamp(28px, 5vw, 72px) !important;
        overflow: hidden !important;
        background:
            linear-gradient(90deg, rgba(3, 15, 42, 0.24) 0%, rgba(5, 24, 58, 0.18) 48%, rgba(3, 15, 42, 0.66) 100%),
            url("/static/images/fire-login-hero-v2-opt.webp") center / cover no-repeat !important;
    }

    body.login-page .login-v2-stage {
        position: relative !important;
        z-index: 2 !important;
        width: min(1180px, 100%) !important;
        min-height: min(680px, calc(100vh - 96px)) !important;
    }

    body.login-page .login-v2-brand {
        position: absolute !important;
        top: 50% !important;
        left: 0 !important;
        width: min(520px, calc(100% - 520px)) !important;
        transform: translateY(-50%) !important;
    }

    body.login-page .login-v2-card {
        position: absolute !important;
        top: 50% !important;
        right: clamp(32px, 7vw, 96px) !important;
        left: auto !important;
        width: 430px !important;
        max-width: min(430px, calc(100vw - 64px)) !important;
        max-height: none !important;
        transform: translateY(-50%) !important;
        padding: 28px !important;
        display: block !important;
        color: #fff !important;
        overflow: visible !important;
        background: rgba(255, 255, 255, 0.20) !important;
        border: 1px solid rgba(255, 255, 255, 0.34) !important;
        border-radius: 18px !important;
        box-shadow: 0 28px 70px rgba(2, 14, 36, 0.34), 0 0 0 1px rgba(255, 255, 255, 0.14) !important;
    }

    body.login-page .login-v2-head {
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr) !important;
        align-items: center !important;
        gap: 14px !important;
        margin-bottom: 24px !important;
    }

    body.login-page .login-v2-form {
        display: grid !important;
        gap: 18px !important;
        width: 100% !important;
    }

    body.login-page .login-v2 .input-group {
        width: 100% !important;
        display: flex !important;
        flex-wrap: nowrap !important;
    }

    body.login-page .login-v2 .form-control {
        width: 1% !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    body.login-page .login-v2 .form-control,
    body.login-page .login-v2 .input-group-text {
        min-height: 52px !important;
        font-size: 1rem !important;
        background: #fff !important;
        border-color: #D8E6F7 !important;
    }

    body.login-page .login-v2 .input-group-text {
        width: 52px !important;
        min-width: 52px !important;
        justify-content: center !important;
    }

    body.login-page .login-v2-submit {
        width: 100% !important;
        min-height: 52px !important;
        font-size: 1.05rem !important;
    }
}

/* User dashboard polish: denser mobile summary without nested-card weight. */
body.user-dashboard-page .user-home-hero {
    min-height: 132px;
    margin-bottom: 12px !important;
    padding: 24px 28px !important;
    border-radius: 10px;
    background:
        linear-gradient(90deg, rgba(6, 32, 74, 0.96) 0%, rgba(14, 70, 156, 0.78) 48%, rgba(14, 70, 156, 0.16) 100%),
        url("/static/images/20260514-175519-opt.webp") right center / cover no-repeat;
}

body.user-dashboard-page .user-home-hero .hero-copy {
    max-width: 62%;
}

body.user-dashboard-page .user-home-hero .hero-copy h2 {
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2.45rem);
    line-height: 1.15;
}

body.user-dashboard-page .user-home-hero .hero-copy p,
body.user-dashboard-page .user-home-hero .hero-status-strip,
body.user-dashboard-page .user-home-hero .hero-kicker {
    display: none !important;
}

body.user-dashboard-page .user-notice-strip {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    margin: 0 0 14px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #DCEBFF;
    border-radius: 10px;
    box-shadow: 0 10px 26px rgba(9, 42, 98, 0.08);
}

body.user-dashboard-page .user-notice-head {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 96px;
}

body.user-dashboard-page .user-notice-head span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0F4699;
    font-size: 0.9rem;
    font-weight: 900;
    white-space: nowrap;
}

body.user-dashboard-page .user-notice-head small {
    color: #64748B;
    font-size: 0.74rem;
    font-weight: 700;
}

body.user-dashboard-page .user-notice-scroll {
    min-width: 0;
    overflow: hidden;
    padding: 2px 0 4px;
}

body.user-dashboard-page .user-notice-track {
    display: flex;
    width: max-content;
    animation: userNoticeTicker 24s linear infinite;
    will-change: transform;
}

body.user-dashboard-page .user-notice-scroll:hover .user-notice-track,
body.user-dashboard-page .user-notice-scroll:focus-within .user-notice-track {
    animation-play-state: paused;
}

body.user-dashboard-page .user-notice-group {
    display: flex;
    flex: 0 0 auto;
    gap: 10px;
    padding-right: 10px;
}

@keyframes userNoticeTicker {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-25%);
    }
}

body.user-dashboard-page .user-notice-card {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    min-width: auto;
    padding: 2px 32px 2px 0;
    color: #172033;
    text-decoration: none;
    background: transparent;
    border: 0;
    border-radius: 0;
    transition: color 0.16s ease;
}

body.user-dashboard-page .user-notice-card:hover {
    color: #0F4699;
}

body.user-dashboard-page .notice-dot {
    flex: 0 0 7px;
    width: 7px;
    height: 7px;
    background: #1F66D8;
    border-radius: 999px;
    box-shadow: 0 0 0 4px rgba(31, 102, 216, 0.10);
}

body.user-dashboard-page .notice-copy {
    display: inline-flex;
    align-items: baseline;
    gap: 0;
    min-width: auto;
    white-space: nowrap;
}

body.user-dashboard-page .notice-copy strong,
body.user-dashboard-page .notice-copy small {
    display: inline;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}

body.user-dashboard-page .notice-copy strong {
    color: #0F172A;
    font-size: 0.92rem;
    font-weight: 900;
}

body.user-dashboard-page .notice-copy small {
    color: #64748B;
    font-size: 0.84rem;
    font-weight: 700;
}

body.user-dashboard-page .notice-copy small::before {
    content: "：";
}

body.user-dashboard-page .user-notice-card > i {
    display: none;
}

body.user-dashboard-page .user-home-summary {
    grid-template-columns: minmax(260px, 0.88fr) minmax(0, 1.12fr);
    gap: 12px;
    margin: 0 0 14px;
    padding: 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 32px rgba(9, 42, 98, 0.10);
}

body.user-dashboard-page .salary-primary {
    min-height: 160px;
    padding: 18px;
    background:
        linear-gradient(135deg, rgba(239, 246, 255, 0.98), rgba(255, 255, 255, 0.94)),
        linear-gradient(90deg, rgba(21, 101, 192, 0.08), transparent 46%);
    border-color: #DCEBFF;
}

body.user-dashboard-page .salary-primary-head,
body.user-dashboard-page .salary-primary-meta,
body.user-dashboard-page .salary-access-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

body.user-dashboard-page .salary-primary-head .metric-label {
    min-width: 0;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 800;
}

body.user-dashboard-page .salary-month-pill {
    flex: 0 0 auto;
    padding: 4px 8px;
    color: #0F4699;
    font-size: 0.8rem;
    font-weight: 900;
    line-height: 1.2;
    background: #EAF3FF;
    border: 1px solid #D7E8FF;
    border-radius: 999px;
}

body.user-dashboard-page .salary-primary-value {
    margin-top: 12px;
    color: #061A3B;
    font-size: clamp(2.3rem, 5.4vw, 3.5rem);
    font-weight: 900;
    letter-spacing: 0;
}

body.user-dashboard-page .salary-primary-meta {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: 12px;
    color: #64748B;
    font-size: 0.86rem;
}

body.user-dashboard-page .salary-primary-meta span {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    white-space: nowrap;
}

body.user-dashboard-page .salary-primary-meta strong {
    color: #172033;
    font-weight: 900;
}

body.user-dashboard-page .salary-mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

body.user-dashboard-page .salary-mini-item {
    min-height: 86px;
    padding: 13px 14px;
    background: #FBFDFF;
    border-color: #E2ECF8;
    box-shadow: none;
}

body.user-dashboard-page .salary-mini-item span {
    color: #64748B;
    font-size: 0.84rem;
    font-weight: 800;
}

body.user-dashboard-page .salary-mini-item strong {
    margin-top: 8px;
    color: #0F172A;
    font-size: clamp(1.05rem, 2vw, 1.28rem);
    font-weight: 900;
}

body.user-dashboard-page .salary-access-row {
    grid-column: 1 / -1;
    min-height: 40px;
    padding: 9px 12px;
    color: #475569;
    font-size: 0.86rem;
    font-weight: 800;
    background: #F8FBFF;
    border: 1px solid #E2ECF8;
    border-radius: 8px;
}

body.user-dashboard-page .salary-access-row span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

body.user-dashboard-page .salary-access-row i {
    color: #1F66D8;
}

body.user-dashboard-page .salary-access-row strong {
    color: #047857;
    font-weight: 900;
}

body.user-dashboard-page .toolbar-panel {
    margin-bottom: 14px;
}

body.user-dashboard-page .analytics-grid {
    margin-top: 0;
}

@media (min-width: 1024px) {
    body.user-dashboard-page .app-body {
        grid-template-columns: 216px minmax(0, 1fr);
    }

    body.user-dashboard-page .app-sidebar {
        padding: 24px 16px;
    }

    body.user-dashboard-page .app-main {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 24px 32px 36px;
    }

    body.user-dashboard-page .user-home-hero {
        min-height: 150px;
    }

    body.user-dashboard-page .user-home-summary {
        grid-template-columns: minmax(320px, 0.92fr) minmax(430px, 1.08fr);
        align-items: stretch;
    }

    body.user-dashboard-page .analytics-grid {
        grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
        gap: 16px;
    }
}

@media (min-width: 1600px) {
    body.user-dashboard-page .app-main {
        padding-left: 40px;
        padding-right: 40px;
    }
}

@media (max-width: 768px) {
    body.user-dashboard-page {
        background: #F4F8FF;
    }

    body.user-dashboard-page .app-main {
        padding-top: 12px !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    body.user-dashboard-page .user-home-hero {
        min-height: 92px !important;
        margin-bottom: 10px !important;
        padding: 14px 16px !important;
        border-radius: 10px !important;
        background:
            linear-gradient(90deg, rgba(6, 32, 74, 0.98) 0%, rgba(14, 70, 156, 0.78) 54%, rgba(14, 70, 156, 0.08) 100%),
            url("/static/images/20260514-175519-opt.webp") 72% center / cover no-repeat !important;
    }

    body.user-dashboard-page .user-home-hero .hero-copy {
        max-width: 74% !important;
        padding-right: 0 !important;
    }

    body.user-dashboard-page .user-home-hero .hero-copy h2 {
        font-size: clamp(1.32rem, 7vw, 1.8rem) !important;
        line-height: 1.18;
        white-space: normal;
    }

    body.user-dashboard-page .user-notice-strip {
        display: block;
        margin: 0 0 10px;
        padding: 10px;
    }

    body.user-dashboard-page .user-notice-head {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 8px;
    }

    body.user-dashboard-page .user-notice-head small {
        font-size: 0.72rem;
    }

    body.user-dashboard-page .user-notice-card {
        flex-basis: auto;
        padding: 2px 26px 2px 0;
    }

    body.user-dashboard-page .notice-copy strong {
        font-size: 0.86rem;
    }

    body.user-dashboard-page .notice-copy small {
        font-size: 0.78rem;
    }

    body.user-dashboard-page .user-home-summary {
        display: grid;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        margin: 0 0 10px !important;
        padding: 0 !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    body.user-dashboard-page .salary-primary {
        min-height: 0 !important;
        padding: 17px 18px !important;
        border-radius: 10px !important;
        box-shadow: 0 10px 24px rgba(9, 42, 98, 0.08);
    }

    body.user-dashboard-page .salary-primary-head .metric-label {
        font-size: 0.92rem !important;
        white-space: nowrap;
    }

    body.user-dashboard-page .salary-month-pill {
        padding: 4px 7px;
        font-size: 0.78rem;
    }

    body.user-dashboard-page .salary-primary-value {
        margin-top: 10px;
        font-size: clamp(2.45rem, 13vw, 3.25rem) !important;
        line-height: 1.04 !important;
        white-space: nowrap;
        overflow-wrap: normal !important;
    }

    body.user-dashboard-page .salary-primary-meta {
        margin-top: 12px;
        gap: 8px 12px;
        font-size: 0.82rem !important;
    }

    body.user-dashboard-page .salary-mini-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    body.user-dashboard-page .salary-mini-item {
        min-height: 76px !important;
        padding: 11px 12px !important;
        border-radius: 10px !important;
        background: #fff !important;
        box-shadow: 0 8px 18px rgba(9, 42, 98, 0.055);
    }

    body.user-dashboard-page .salary-mini-item span {
        margin: 0 !important;
        font-size: 0.78rem !important;
    }

    body.user-dashboard-page .salary-mini-item strong {
        margin-top: 7px;
        font-size: clamp(1.04rem, 5vw, 1.28rem) !important;
        line-height: 1.15 !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body.user-dashboard-page .salary-access-row {
        min-height: 38px;
        padding: 8px 10px;
        background: #fff;
        box-shadow: 0 8px 18px rgba(9, 42, 98, 0.045);
    }

    body.user-dashboard-page .toolbar-panel {
        margin-bottom: 10px;
        padding: 12px !important;
    }

    body.user-dashboard-page .toolbar-title span {
        display: none;
    }

    body.user-dashboard-page .analytics-grid {
        gap: 10px !important;
    }
}

.notice-detail-page {
    max-width: 880px;
    margin: 0 auto;
}

.notice-back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 14px;
    color: #1F66D8;
    font-size: 0.92rem;
    font-weight: 900;
    text-decoration: none;
}

.notice-back-link:hover {
    color: #0F4699;
}

.notice-detail-card {
    padding: 28px;
    background: #fff;
    border: 1px solid #DCEBFF;
    border-radius: 10px;
    box-shadow: 0 18px 40px rgba(9, 42, 98, 0.10);
}

.notice-detail-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    color: #64748B;
    font-size: 0.86rem;
    font-weight: 800;
}

.notice-detail-meta span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #0F4699;
}

.notice-detail-card h1 {
    margin: 0;
    color: #061A3B;
    font-size: clamp(1.65rem, 3vw, 2.25rem);
    font-weight: 900;
    line-height: 1.22;
}

.notice-detail-summary {
    margin: 14px 0 0;
    color: #475569;
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.7;
}

.notice-detail-content {
    margin-top: 22px;
    color: #172033;
    font-size: 0.98rem;
    line-height: 1.85;
}

.notice-detail-content p {
    margin: 0 0 12px;
}

@media (max-width: 768px) {
    .notice-detail-card {
        padding: 20px 18px;
        border-radius: 10px;
    }

    .notice-detail-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }
}

@media (max-width: 390px) {
    body.user-dashboard-page .salary-primary {
        padding: 15px !important;
    }

    body.user-dashboard-page .salary-primary-value {
        font-size: clamp(2.25rem, 12vw, 2.85rem) !important;
    }

    body.user-dashboard-page .salary-mini-item {
        padding: 10px !important;
    }

    body.user-dashboard-page .salary-mini-item strong {
        font-size: 1rem !important;
    }
}

body.user-dashboard-page .shop-ad-modal {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .22s ease;
    overflow: auto;
}

body.user-dashboard-page .shop-ad-modal.is-visible {
    pointer-events: auto;
    opacity: 1;
}

body.user-dashboard-page .shop-ad-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .42);
    backdrop-filter: blur(4px);
}

body.user-dashboard-page .shop-ad-card {
    position: relative;
    width: min(420px, 100%);
    max-height: calc(100vh - 36px);
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 22px 64px rgba(15, 23, 42, .28);
    transform: translateY(10px) scale(.98);
    transition: transform .22s ease;
}

body.user-dashboard-page .shop-ad-modal.is-visible .shop-ad-card {
    transform: translateY(0) scale(1);
}

body.user-dashboard-page .shop-ad-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(15, 23, 42, .62);
    display: grid;
    place-items: center;
}

body.user-dashboard-page .shop-ad-image {
    display: block;
    height: 250px;
    background: #f1f5f9;
}

body.user-dashboard-page .shop-ad-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

body.user-dashboard-page .shop-ad-image span {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: #1f66d8;
    font-size: 42px;
}

body.user-dashboard-page .shop-ad-copy {
    padding: 18px;
}

body.user-dashboard-page .shop-ad-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #1f66d8;
    font-size: 13px;
    font-weight: 800;
}

body.user-dashboard-page .shop-ad-copy h3 {
    margin: 8px 0 6px;
    color: #0f172a;
    font-size: 21px;
    font-weight: 900;
    line-height: 1.25;
}

body.user-dashboard-page .shop-ad-copy p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.55;
}

body.user-dashboard-page .shop-ad-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

body.user-dashboard-page .shop-ad-foot strong {
    color: #dc2626;
    font-size: 24px;
    line-height: 1;
}

@media (max-width: 430px) {
    body.user-dashboard-page .shop-ad-modal {
        padding: 12px;
    }

    body.user-dashboard-page .shop-ad-card {
        border-radius: 16px;
        max-height: calc(100vh - 24px);
    }

    body.user-dashboard-page .shop-ad-image {
        height: 210px;
    }

    body.user-dashboard-page .shop-ad-copy h3 {
        font-size: 19px;
    }
}

/* 用户端 APP 同步主题：统一顶部栏、导航、页面容器、卡片、表单和数据展示。 */
body.user-portal {
    --user-primary: #1E4939;
    --user-primary-2: #3F7054;
    --user-primary-soft: #E7EFE9;
    --user-bg: #F3F6F3;
    --user-surface: #FFFFFF;
    --user-surface-soft: #F7F9F7;
    --user-text: #17231D;
    --user-muted: #68766E;
    --user-border: #DDE6DF;
    background: var(--user-bg);
    color: var(--user-text);
    font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

body.user-portal .app-shell,
body.user-portal .app-body {
    background: var(--user-bg);
}

body.user-portal .app-topbar {
    min-height: 72px;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--user-border);
    box-shadow: 0 8px 28px rgba(30, 73, 57, .07);
    backdrop-filter: blur(16px);
}

body.user-portal .brand-lockup strong {
    color: var(--user-primary);
}

body.user-portal .brand-lockup small,
body.user-portal .topbar-motto,
body.user-portal .topbar-icon {
    color: var(--user-muted);
}

body.user-portal .user-chip {
    color: var(--user-primary);
    background: var(--user-primary-soft);
    border-color: #D5E2D8;
}

body.user-portal .logout-link {
    color: #A33A3A;
    background: #FFF3F3;
    border-color: #F1D9D9;
}

body.user-portal .app-sidebar {
    background: #FAFCFA;
    border-right: 1px solid var(--user-border);
}

body.user-portal .side-link {
    min-height: 48px;
    color: #526158;
    border-radius: 14px;
}

body.user-portal .side-link:hover {
    color: var(--user-primary);
    background: #EFF4F0;
}

body.user-portal .side-link.active {
    color: #fff;
    background: linear-gradient(135deg, var(--user-primary), var(--user-primary-2));
    box-shadow: 0 10px 24px rgba(30, 73, 57, .20);
}

body.user-portal .app-main {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 28px 40px;
}

body.user-portal .btn-primary {
    color: #fff;
    background: var(--user-primary);
    border-color: var(--user-primary);
    box-shadow: none !important;
}

body.user-portal .btn-primary:hover,
body.user-portal .btn-primary:focus {
    background: #153C2E;
    border-color: #153C2E;
}

body.user-portal .btn-outline-primary {
    color: var(--user-primary);
    border-color: #AFC6B5;
}

body.user-portal .btn-outline-primary:hover,
body.user-portal .btn-outline-primary:focus {
    color: #fff;
    background: var(--user-primary);
    border-color: var(--user-primary);
}

body.user-portal .text-fire-blue,
body.user-portal .text-primary {
    color: var(--user-primary) !important;
}

body.user-portal .form-control,
body.user-portal .form-select,
body.user-portal .input-group-text {
    min-height: 46px;
    color: var(--user-text);
    background: var(--user-surface-soft);
    border-color: var(--user-border);
    border-radius: 12px;
}

body.user-portal .form-control:focus,
body.user-portal .form-select:focus {
    background: #fff;
    border-color: #79A086;
    box-shadow: 0 0 0 3px rgba(63, 112, 84, .14);
}

body.user-portal .toolbar-panel,
body.user-portal .analytics-card,
body.user-portal .panel-card,
body.user-portal .salary-record-card,
body.user-portal .profile-card,
body.user-portal .shopfront-shell,
body.user-portal .shop-mall-card,
body.user-portal .accordion-item,
body.user-portal .modal-content {
    border-color: var(--user-border);
    border-radius: 18px;
    background: var(--user-surface);
    box-shadow: 0 10px 26px rgba(30, 73, 57, .07);
}

body.user-portal .section-title-row,
body.user-portal .toolbar-title h3,
body.user-portal .analytics-head h5 {
    color: var(--user-text);
}

body.user-portal .salary-record-card {
    margin-bottom: 14px;
    overflow: hidden;
}

body.user-portal .salary-record-head {
    padding: 18px 20px;
}

body.user-portal .salary-record-body,
body.user-portal .salary-detail-section {
    background: var(--user-surface-soft);
}

body.user-portal .salary-month,
body.user-portal .salary-summary .total-row:last-child {
    color: var(--user-primary);
}

body.user-portal .shop-category-chip.active,
body.user-portal .role-tab.active {
    color: #fff;
    background: var(--user-primary);
    border-color: var(--user-primary);
}

body.user-portal .alert {
    border-radius: 14px;
}

@media (max-width: 991px) {
    body.user-portal .app-main {
        max-width: none;
        padding: 16px 14px calc(96px + env(safe-area-inset-bottom));
    }

    body.user-portal .app-sidebar {
        background: rgba(255, 255, 255, .97);
        border-top: 1px solid var(--user-border);
        box-shadow: 0 -10px 28px rgba(30, 73, 57, .10);
    }

    body.user-portal .side-link {
        min-height: 52px;
        border-radius: 12px;
    }
}
