/* CSS variables for consistent UI colors and spacing */
:root {
    --bg-dark: #0b0f19;
    --bg-card: rgba(20, 26, 42, 0.65);
    --bg-sidebar: rgba(13, 18, 32, 0.95);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    
    --primary-accent: #8b5cf6; /* Purple */
    --primary-glow: rgba(139, 92, 246, 0.25);
    
    --green-accent: #10b981; /* Green */
    --green-glow: rgba(16, 185, 129, 0.2);
    
    --blue-accent: #3b82f6; /* Blue */
    --blue-glow: rgba(59, 130, 246, 0.2);
    
    --orange-accent: #f59e0b; /* Orange */
    --orange-glow: rgba(245, 158, 11, 0.2);
    
    --red-accent: #ef4444; /* Red */
    
    --font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

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

html, body {
    background-color: #0b0f19 !important;
    background: #0b0f19 !important;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
    height: 100%;
    width: 100%;
}

.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background-color: #0b0f19 !important;
    background: #0b0f19 !important;
}

/* Scrollbar customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Sidebar styling */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    flex-shrink: 0;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary-accent), var(--blue-accent));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .92rem;
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.logo-text h2 {
    font-family: var(--font-heading);
    font-size: .92rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #fff;
}

.logo-text span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 1px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.nav-item:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
    color: #fff;
    background-color: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    box-shadow: 0 0 15px var(--primary-glow);
}

.sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--green-accent);
    box-shadow: 0 0 8px var(--green-glow);
}

/* Main Content styling */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 1.5rem 2rem;
    min-height: 0;
    position: relative;
}

.top-app-header {
    display: block;
    width: 100%;
    margin: 0 0 1.25rem 0;
    padding-bottom: 0.5rem;
    flex-shrink: 0;
}

.main-header {
    position: static !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin: 0 0 0.5rem 0 !important;
    padding: 0 0 1rem 0 !important;
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    min-height: 48px !important;
    box-sizing: border-box !important;
}

.header-title {
    display: flex !important;
    align-items: center !important;
}

.header-title h1 {
    font-family: var(--font-heading) !important;
    font-size: 1.55rem !important;
    font-weight: 600 !important;
    color: #fff !important;
    margin: 0 !important;
    line-height: 1.2 !important;
}

.date-selector-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.custom-select {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 0.5rem 2rem 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: var(--font-body);
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: border-color 0.2s;
}

.custom-select:focus {
    border-color: var(--primary-accent);
}

/* Glassmorphism utility card */
.glass {
    background-color: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Stats Cards styling */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
}

.stat-icon.purple {
    background-color: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.2);
    box-shadow: inset 0 0 10px rgba(139, 92, 246, 0.1);
    color: var(--primary-accent);
}

.stat-icon.green {
    background-color: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.2);
    box-shadow: inset 0 0 10px rgba(16, 185, 129, 0.1);
    color: var(--green-accent);
}

.stat-icon.blue {
    background-color: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: inset 0 0 10px rgba(59, 130, 246, 0.1);
    color: var(--blue-accent);
}

.stat-info h3 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.stat-info p {
    font-family: var(--font-heading);
    font-size: 1.65rem;
    font-weight: 700;
    color: #fff;
}

/* Charts styling */
.charts-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.chart-box {
    padding: 1.5rem;
}

.chart-box h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-box h3 i {
    color: var(--primary-accent);
}

.chart-div {
    width: 100%;
    height: 320px;
}

.large-chart-div {
    width: 100%;
    height: 380px;
}

/* Tab Panels */
.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Daily Reimbursement layouts */
.reimburse-header {
    margin-bottom: 1.5rem;
}

.alert-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    background-color: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 12px;
}

.alert-info i {
    color: var(--blue-accent);
    font-size: 1.1rem;
}

.reimburse-column-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.reimburse-card {
    display: flex;
    flex-direction: column;
    min-height: 480px;
}

.card-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

.card-header.user-me {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.1), transparent);
    border-left: 4px solid var(--primary-accent);
}

.card-header.user-chen {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.1), transparent);
    border-left: 4px solid var(--orange-accent);
}

.card-header.user-tao {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.1), transparent);
    border-left: 4px solid var(--blue-accent);
}

.header-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-sum {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
}

.card-body {
    flex-grow: 1;
    padding: 1rem;
    overflow-y: auto;
    max-height: 380px;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.reimburse-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.reimburse-table th {
    text-align: left;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.reimburse-table td {
    padding: 0.65rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.empty-row {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem 0 !important;
}

.card-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.btn {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
}

.btn-copy:hover {
    border-color: var(--primary-accent);
    color: #fff;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
}

/* Periodic tables and Flat tables */
.periodic-layout {
    padding: 1.5rem;
}

.periodic-header {
    margin-bottom: 1.5rem;
}

.periodic-header h3 {
    font-size: 1.15rem;
    color: #fff;
    margin-bottom: 0.25rem;
}

.periodic-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.flat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.flat-table th {
    text-align: left;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-bottom: 1.5px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.01);
}

.flat-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.flat-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.01);
}

/* Price trends layout */
.trend-card {
    padding: 1.5rem;
}

.trend-header h3 {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 0.25rem;
}

.trend-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Upload Center styling */
.upload-container {
    padding: 2.5rem;
    max-width: 680px;
    margin: 0 auto;
}

.upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 3.5rem 2rem;
    text-align: center;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.01);
    transition: all 0.3s ease;
}

.upload-area:hover, .upload-area.drag-over {
    border-color: var(--primary-accent);
    background-color: rgba(139, 92, 246, 0.03);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.05);
}

.upload-icon {
    font-size: 3.5rem;
    color: var(--primary-accent);
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 10px rgba(139, 92, 246, 0.2));
}

.upload-area h3 {
    font-size: 1.15rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.upload-area p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.file-format-tip {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background-color: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.upload-progress-container {
    margin-top: 2rem;
    display: none;
}

.progress-bar-wrapper {
    width: 100%;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-accent), var(--blue-accent));
    transition: width 0.1s ease;
}

#progress-status {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
}

.upload-instructions {
    margin-top: 2.5rem;
    padding: 1.25rem;
}

.upload-instructions h4 {
    font-size: 0.95rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.upload-instructions ul {
    list-style-position: inside;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Toast styling */
#toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background-color: rgba(13, 18, 32, 0.95);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    animation: slideIn 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.toast.success {
    border-left: 4px solid var(--green-accent);
}

.toast.success i {
    color: var(--green-accent);
}

.toast.error {
    border-left: 4px solid var(--red-accent);
}

.toast.error i {
    color: var(--red-accent);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.handler-select {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 0.25rem 1.5rem 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='16' viewBox='0 0 24 24' width='16' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 4px center;
    transition: border-color 0.2s;
}

.handler-select:focus {
    border-color: var(--primary-accent);
}

.card-header.user-chuanhai {
    background: linear-gradient(90deg, rgba(236, 72, 153, 0.1), transparent);
    border-left: 4px solid #ec4899;
}

.periodic-summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.p-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.p-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
}

.p-card.frog::after {
    background: var(--purple-accent);
}

.p-card.fish::after {
    background: var(--blue-accent);
}

.p-card.frozen::after {
    background: var(--green-accent);
}

.p-card-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.p-card-value {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    font-family: var(--font-body);
}

/* Accordion Container */
.accordion-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Month Accordion */
.month-accordion {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--bg-card);
    overflow: hidden;
    transition: all 0.3s ease;
}

.month-accordion.open {
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.05);
}

.month-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.02);
    user-select: none;
    transition: background-color 0.2s;
}

.month-header:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

.month-title {
    font-size: .92rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.month-title i {
    color: var(--primary-accent);
}

.month-summary {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.month-total {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.month-toggle-icon {
    font-size: 1rem;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.month-accordion.open .month-toggle-icon {
    transform: rotate(180deg);
}

.month-body {
    display: none;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background-color: rgba(11, 15, 25, 0.4);
}

.month-accordion.open .month-body {
    display: block;
}

/* Day Accordion (Inside Month Body) */
.day-accordion {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    background-color: rgba(20, 26, 42, 0.4);
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.day-accordion:last-child {
    margin-bottom: 0;
}

.day-accordion.open {
    border-color: rgba(59, 130, 246, 0.3);
}

.day-header {
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.01);
    user-select: none;
    transition: background-color 0.2s;
}

.day-header:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.day-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.day-title i {
    color: var(--blue-accent);
}

.day-summary-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.day-sums-badge {
    background-color: rgba(255, 255, 255, 0.04);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.day-total-sum {
    font-family: var(--font-heading);
    font-weight: 700;
    color: #fff;
    font-size: 1rem;
}

.day-toggle-icon {
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.day-accordion.open .day-toggle-icon {
    transform: rotate(180deg);
}

.day-body {
    display: none;
    padding: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background-color: rgba(11, 15, 25, 0.2);
}

.day-accordion.open .day-body {
    display: block;
}

/* Supplier List Styling (Supplier Accordion Content) */
.supplier-table {
    width: 100%;
    border-collapse: collapse;
}

.supplier-table th {
    text-align: left;
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    border-bottom: 1.5px solid var(--border-color);
    font-weight: 500;
    font-size: 0.85rem;
}

.supplier-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.supplier-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.supplier-table tr:nth-child(1) .supplier-rank-badge {
    background-color: rgba(245, 158, 11, 0.2);
    color: var(--orange-accent);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.supplier-table tr:nth-child(2) .supplier-rank-badge {
    background-color: rgba(59, 130, 246, 0.2);
    color: var(--blue-accent);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.supplier-table tr:nth-child(3) .supplier-rank-badge {
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--green-accent);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Proportion bar visual */
.proportion-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.proportion-bar-bg {
    flex-grow: 1;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
    max-width: 120px;
}

.proportion-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--primary-accent), var(--blue-accent));
}

.proportion-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    min-width: 32px;
}

/* Category filter button group */
.category-filter-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.filter-btn {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.45rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
    font-weight: 500;
}

.filter-btn:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.filter-btn.active {
    background-color: var(--primary-accent);
    color: #fff;
    border-color: var(--primary-accent);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Custom settled status switch / checkbox */
.status-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-checkbox-label input[type="checkbox"] {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--text-secondary);
    border-radius: 4px;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    outline: none;
    cursor: pointer;
}

.status-checkbox-label input[type="checkbox"]:checked {
    border-color: var(--green-accent);
    background-color: var(--green-accent);
}

.status-checkbox-label input[type="checkbox"]:checked::after {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: #fff;
    font-size: 9px;
}

.status-text-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-text-badge.unsettled {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--orange-accent);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-text-badge.settled {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--green-accent);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Daily summary table layout */
.summary-table {
    width: 100%;
    border-collapse: collapse;
}

.summary-table th {
    text-align: left;
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    border-bottom: 1.5px solid var(--border-color);
    font-weight: 500;
    font-size: 0.9rem;
}

.summary-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.summary-table tr:hover {
    background-color: rgba(255, 255, 255, 0.01);
}

/* Change status badges */
.change-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    margin-left: 6px;
    transition: all 0.2s ease;
}

.change-status-badge.modified {
    background-color: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.change-status-badge.modified:hover {
    background-color: rgba(239, 68, 68, 0.25);
}

.change-status-badge.new {
    background-color: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.change-status-badge.new:hover {
    background-color: rgba(59, 130, 246, 0.25);
}

.change-status-badge i {
    font-size: 0.65rem;
    opacity: 0.8;
}

/* Day alert dot */
.day-alert-dot {
    color: var(--orange-accent);
    margin-left: 8px;
    font-size: 0.85rem;
    animation: pulse 1.5s infinite;
    display: inline-block;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* Day ack banner */
.day-ack-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(245, 158, 11, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: 6px;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.day-ack-banner .btn-ack {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
    transition: all 0.2s ease;
}

.day-ack-banner .btn-ack:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.3);
}

/* ==========================================================================
   账本与对账中心 (Tab 7) Styles
   ========================================================================== */

.reconcile-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 1.5rem;
    align-items: start;
}

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

.column-header-box {
    padding: 1rem 1.25rem;
    border-radius: 12px;
}

.column-header-box h3 {
    font-size: 1.1rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.column-header-box h3 i {
    color: var(--primary-accent);
}

.column-header-box p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Bookkeeping and forms */
.btn-group-toggle {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.btn-group-toggle .btn {
    flex: 1;
    justify-content: center;
    padding: 0.65rem 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-group-toggle .btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.btn-group-toggle .btn.active {
    background: var(--primary-accent);
    color: #fff;
    border-color: var(--primary-accent);
    box-shadow: 0 0 12px var(--primary-glow);
}

.btn-group-toggle.small .btn {
    padding: 0.4rem 0.25rem;
    font-size: 0.8rem;
}

.btn-group-toggle.small .btn.active {
    background: rgba(139, 92, 246, 0.2);
    color: #fff;
    border-color: var(--primary-accent);
    box-shadow: none;
}

.category-toggle-wrap {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#manual-input-text {
    width: 100%;
    height: 120px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
    padding-right: 3rem;
    color: #fff;
    font-size: 0.9rem;
    outline: none;
    font-family: inherit;
    resize: none;
    transition: border-color 0.2s ease;
}

#manual-input-text:focus {
    border-color: var(--primary-accent);
}

.voice-input-btn {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.voice-input-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.voice-input-btn.recording {
    background: var(--red-accent);
    color: #fff;
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.btn-block {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.empty-placeholder {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Ledger Items List */
.ledger-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.ledger-item-row:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateX(2px);
}

.ledger-item-row .item-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    flex: 1;
}

.ledger-item-row .item-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ledger-item-row .item-amount {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    margin-left: auto;
    margin-right: 0.75rem;
}

.ledger-item-row .item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tag-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.tag-badge.mine {
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.25);
    color: #a78bfa;
}

.tag-badge.chen {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #fbbf24;
}

.tag-badge.settle {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: #60a5fa;
}

.reimb-action-btn {
    border: 1px solid transparent;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reimb-action-btn.pending {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.reimb-action-btn.pending:hover {
    background: rgba(245, 158, 11, 0.25);
}

.reimb-action-btn.done {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.reimb-action-btn.done:hover {
    background: rgba(16, 185, 129, 0.25);
}

.btn-delete {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red-accent);
}

/* Comparison View Styling */
.check-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.check-badge.pass {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.check-badge.fail {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.check-badge.partial {
    background: rgba(245, 158, 11, 0.16);
    border: 1px solid rgba(245, 158, 11, 0.36);
    color: #fbbf24;
}

.check-badge-sub {
    display: block;
    margin-top: 2px;
    font-size: 0.68rem;
    line-height: 1.1;
    font-weight: 500;
    color: rgba(251, 191, 36, 0.82);
}

.check-badge.none {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.comparison-summary-cards .comp-card {
    transition: border-color 0.2s ease;
}

.comparison-summary-cards .comp-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.comp-row span {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.comp-row b {
    font-family: var(--font-mono);
    font-weight: 600;
}

.comp-row.total b {
    font-weight: 700;
}

.comp-row.total b.color-ok {
    color: var(--green-accent);
}

.comp-row.total b.color-error {
    color: var(--red-accent);
}

/* Side by Side scroll lists */
.details-scroll {
    overflow-y: auto;
    max-height: 250px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding-right: 4px;
}

.detail-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.8rem;
}

.detail-item-row .info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.detail-item-row .name {
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-item-row .meta {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.detail-item-row .value {
    font-family: var(--font-mono);
    font-weight: 700;
    color: #fff;
    margin-left: 6px;
    font-size: 0.85rem;
}

/* Alert/Reminder bar */
.reimb-reminders-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.5rem;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.08) !important;
    border: 1px solid rgba(239, 68, 68, 0.25) !important;
}

.reimb-reminders-bar .reminder-content {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    color: #fca5a5;
    font-size: 0.9rem;
}

.reimb-reminders-bar i {
    color: var(--red-accent);
    font-size: 1.15rem;
}

.import-reminder-bar {
    margin-top: 0.25rem;
}

.import-reminder-bar .btn {
    border: 1px solid rgba(255,255,255,0.14);
}

.animated-pulse {
    animation: pulse 1.5s infinite;
}

/* Canvas crop screen styles */
.crop-canvas-container {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.ocr-upload-btn:hover {
    border-color: var(--primary-accent) !important;
    background-color: rgba(139, 92, 246, 0.05);
}

.crop-rect {
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.65);
}

.ocr-result-item {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.ocr-result-item input {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: #fff;
    padding: 4px 8px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.ocr-result-item input:focus {
    border-color: var(--primary-accent);
}

/* Form layouts in modal sheet */
.form-group label {
    margin-bottom: 4px;
    font-weight: 500;
}

.form-group input, .form-group select {
    outline: none;
    transition: border-color 0.2s ease;
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--primary-accent) !important;
}

.edit-sheet {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

/* Reconciliation cockpit redesign */
#tab-reconciliation-center .ocr-tool-card { display: none !important; }
#tab-reconciliation-center .recon-command-center {
    position: sticky;
    top: 0.75rem;
    z-index: 12;
    display: grid;
    grid-template-columns: auto minmax(420px, 1fr) auto;
    gap: 1rem;
    align-items: stretch;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(15,23,42,.92), rgba(24,31,51,.88));
    border: 1px solid rgba(148,163,184,.18);
    box-shadow: 0 18px 48px rgba(0,0,0,.22);
    backdrop-filter: blur(18px);
}
.recon-date-cluster { display:flex; align-items:center; gap:.55rem; }
.recon-date-input {
    min-width: 160px;
    height: 48px;
    background: rgba(255,255,255,.08) !important;
    border: 1px solid rgba(255,255,255,.16) !important;
    border-radius: 14px !important;
    color: #fff !important;
    font-weight: 800;
    text-align: center;
}
.sticky-kpi-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.recon-kpi-card {
    border-radius: 16px;
    padding: .8rem 1rem;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.09);
    min-height: 76px;
}
.recon-kpi-card span { display:block; font-size:.78rem; color:rgba(255, 255, 255, 0.58); font-weight:700; }
.recon-kpi-card b { display:block; margin-top:.25rem; font-size:1.25rem; line-height:1.1; }
.recon-kpi-card em { display:block; margin-top:.2rem; font-style:normal; font-size:.72rem; color:rgba(255, 255, 255, 0.48); }
.recon-kpi-card.amber b { color:#fbbf24; }
.recon-kpi-card.rose b { color:#fb7185; }
.recon-kpi-card.blue b { color:#60a5fa; }

.reconcile-three-column-grid {
    display: grid;
    grid-template-columns: 320px 1fr 360px;
    gap: 1rem;
    align-items: stretch;
}
.reconcile-column { display: flex; flex-direction: column; gap: 0.75rem; }
.reconcile-column > * { flex: 1; min-height: 0; }
#tab-reconciliation-center .column-header-box { display:flex; flex-direction:column; justify-content:center; padding: 0.75rem 1rem; border-radius: 12px; }
#tab-reconciliation-center .comparison-summary-cards { align-items:stretch; }
#tab-reconciliation-center .comp-card { min-height: auto; padding: 0.75rem 1rem; border-radius: 12px; }
#tab-reconciliation-center .bookkeeping-card { padding: 1rem; border-radius: 12px; }
#tab-reconciliation-center .ledger-details-card { padding: 1rem; border-radius: 12px; }
#tab-reconciliation-center .side-by-side-details .details-half { padding: 0.75rem; border-radius: 12px; }
#tab-reconciliation-center .periodic-settlement-zone-compact { padding: 0.75rem; border-radius: 12px; }
#tab-reconciliation-center .periodic-writeoff-card { padding: 0.75rem; border-radius: 12px; }
#tab-reconciliation-center .historical-checks-accordion { padding: 0.75rem; border-radius: 12px; }
#tab-reconciliation-center .details-scroll { max-height: 200px; overflow-y: auto; }
#tab-reconciliation-center .comp-card h5, #tab-reconciliation-center .column-header-box h3, #tab-reconciliation-center .periodic-settlement-zone-compact h4, #tab-reconciliation-center .periodic-writeoff-card h4, #tab-reconciliation-center .historical-checks-accordion h3 { font-size: 0.85rem; margin-bottom: 0.4rem; }
#tab-reconciliation-center .comp-row { font-size: 0.8rem; margin-bottom: 0.15rem; }


.periodic-settlement-zone {
    background: radial-gradient(circle at top left, rgba(96,165,250,.1), transparent 40%), rgba(15, 23, 42, 0.75) !important;
    border: 1px solid rgba(96,165,250,.2) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3) !important;
}
.periodic-chip-row { display:flex; flex-wrap:wrap; gap:.75rem; margin-bottom:1.25rem; }
.periodic-chip-row.compact { gap: 0.4rem; margin-bottom: 0.8rem; }
.periodic-chip-row.compact .periodic-chip {
    padding: 0.45rem 0.75rem;
    font-size: 0.82rem;
    border-radius: 10px;
    font-weight: 700;
}
.periodic-chip, .supplier-chip {
    border:1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.03);
    color:#e5e7eb;
    border-radius:14px;
    padding:.75rem 1.25rem;
    cursor:pointer;
    text-align:left;
    font-weight:700;
    transition: all .25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.periodic-chip:hover, .supplier-chip:hover {
    transform: translateY(-2px);
    border-color:rgba(255,255,255,.2);
    background:rgba(255,255,255,.07);
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.periodic-chip.active { box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 12px 28px rgba(0,0,0,.22); }
.periodic-chip[data-periodic-cat="全部"].active {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.2), rgba(59, 130, 246, 0.1));
    border-color: var(--blue-accent);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.25);
}
.periodic-chip.fish.active { background: linear-gradient(135deg, rgba(34,211,238,.24), rgba(37,99,235,.18)); border-color:#22d3ee; box-shadow: 0 0 15px rgba(34, 211, 238, 0.35); }
.periodic-chip.frog.active { background: linear-gradient(135deg, rgba(251,191,36,.24), rgba(249,115,22,.18)); border-color:#fbbf24; box-shadow: 0 0 15px rgba(251, 191, 36, 0.35); }
.periodic-chip.frozen.active { background: linear-gradient(135deg, rgba(167,139,250,.24), rgba(59,130,246,.18)); border-color:#a78bfa; box-shadow: 0 0 15px rgba(167, 139, 250, 0.35); }
.periodic-chip.other.active, .periodic-chip.active:not(.fish):not(.frog):not(.frozen):not([data-periodic-cat="全部"]) { background: linear-gradient(135deg, rgba(148,163,184,.22), rgba(100,116,139,.14)); border-color:#94a3b8; box-shadow: 0 0 15px rgba(148, 163, 184, 0.35); }

.periodic-supplier-cards { display:grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap:1rem; margin-bottom:1.5rem; }
.periodic-supplier-cards.compact {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 0.8rem;
}
.periodic-supplier-cards.compact .supplier-chip {
    min-height: auto;
    padding: 0.5rem 0.8rem;
    border-radius: 10px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    text-align: left;
}
.periodic-supplier-cards.compact .supplier-chip strong {
    font-size: 0.86rem;
    margin: 0;
    font-weight: 700;
}
.periodic-supplier-cards.compact .supplier-chip span {
    margin: 0;
    font-size: 0.78rem;
}
.periodic-supplier-cards.compact .supplier-chip::before {
    width: 3px;
}

.supplier-chip { min-height: 96px; display: flex; flex-direction: column; justify-content: space-between; padding: 1.1rem 1.25rem; }
.supplier-chip strong { display:block; font-size:1rem; font-weight:700; color:#fff; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.supplier-chip span { display:block; margin-top:.5rem; font-size:.8rem; color:var(--text-secondary); font-family: var(--font-mono); }
.supplier-chip::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: rgba(255,255,255,0.15);
    transition: all 0.2s ease;
}

.supplier-chip.fish::before { background: #22d3ee; }
.supplier-chip.frog::before { background: #fbbf24; }
.supplier-chip.frozen::before { background: #a78bfa; }
.supplier-chip.other::before { background: #94a3b8; }
.supplier-chip.all::before { background: #3b82f6; }

.supplier-chip.active { background: rgba(255,255,255,.05); box-shadow: 0 4px 20px rgba(0,0,0,.2); }
.supplier-chip.fish.active { border-color:#22d3ee; background: rgba(34, 211, 238, 0.08); }
.supplier-chip.frog.active { border-color:#fbbf24; background: rgba(251, 191, 36, 0.08); }
.supplier-chip.frozen.active { border-color:#a78bfa; background: rgba(167, 139, 250, 0.08); }
.supplier-chip.other.active { border-color:#94a3b8; background: rgba(148, 163, 184, 0.08); }
.supplier-chip.all.active { border-color:#3b82f6; background: rgba(59, 130, 246, 0.08); }

.periodic-stats-compact {
    display: flex;
    gap: 8px;
    margin-bottom: 0.8rem;
}
.periodic-stats-compact .stat-item {
    flex: 1;
    padding: 6px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

#periodic-outstanding-list .detail-item-row, #sys-details-scroll .detail-item-row, #ledger-items-container .ledger-item-row { border-radius:14px; margin-bottom:.55rem; background:rgba(255,255,255,.035); }

@media (max-width: 1400px) {
    .reconcile-three-column-grid {
        grid-template-columns: 320px 1fr;
    }
    .reconcile-three-column-grid > .reconcile-column:nth-child(3) {
        grid-column: span 2;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.25rem;
    }
}
@media (max-width: 900px) {
    .reconcile-three-column-grid {
        grid-template-columns: 1fr;
    }
    .reconcile-three-column-grid > .reconcile-column:nth-child(3) {
        grid-column: span 1;
        grid-template-columns: 1fr;
    }
}


/* Analysis shells */
.income-shell, .purchase-shell { display:flex; flex-direction:column; gap:1rem; }
.section-hero { border-radius:18px; padding:1rem 1.2rem; display:flex; justify-content:space-between; align-items:center; gap:1rem; }
.section-hero h2 { margin:0; font-size:.92rem; }
.section-hero p { margin:.15rem 0 0; color:var(--text-secondary); font-size:.72rem; }
.kpi-grid-6 { display:grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap:1rem; margin-bottom:1rem; }
.analysis-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:1rem; }
.analysis-grid.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.card-block { border-radius:18px; padding:1rem 1.1rem; }
.card-block h2, .card-block h3 { margin:0 0 .55rem; font-size:.82rem; }
.wage-drawer { border:1px solid rgba(255,255,255,.10) !important; background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.02)) !important; }
.wage-drawer summary { list-style: none; }
.wage-drawer summary::-webkit-details-marker { display:none; }
@media (max-width: 1280px) { .kpi-grid-6 { grid-template-columns: repeat(3,minmax(0,1fr)); } .analysis-grid { grid-template-columns:1fr; } .analysis-grid.grid-3 { grid-template-columns:1fr; } }

/* Management dashboard unified mini list component */
.mgmt-mini-row {
  padding: .88rem .95rem;
  border-radius: 14px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.10);
  margin-bottom: .72rem;
}
.mgmt-mini-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  font-size: .76rem;
}
.mgmt-mini-row-top strong {
  font-size: .76rem;
  letter-spacing: .01em;
}
.mgmt-mini-row-top span {
  color: var(--text-secondary);
  white-space: nowrap;
}
.mgmt-mini-row-amount {
  margin-top: .28rem;
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .01em;
  color: var(--text-primary);
}
.analysis-group { margin-bottom: .9rem; padding-bottom: .5rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.analysis-group-title { font-weight: 800; margin-bottom: .45rem; color: var(--text-primary); }
.analysis-row { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.42rem 0; color:var(--text-secondary); }
.analysis-row b { color:var(--text-primary); font-variant-numeric: tabular-nums; }
.analysis-row em { font-style:normal; margin-left:.35rem; font-size:.78rem; }
.conclusion-line { padding:.65rem 0; border-bottom:1px dashed rgba(255,255,255,.12); color:var(--text-secondary); }
.card-block h2 small, .card-block h3 .tag { font-size:.7rem; color:var(--text-secondary); font-weight:600; margin-left:.45rem; }

/* Compact product-designed cockpit */
.cockpit-kpi-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .65rem; margin-bottom: .9rem; }
.cockpit-kpi { display:flex; flex-direction:column; align-items:flex-start; justify-content:center; gap:.35rem; min-height:74px; padding:.9rem 1rem; border-radius:15px; border:1px solid rgba(255,255,255,.11); background:rgba(255,255,255,.035); }
.cockpit-kpi span { color:var(--text-secondary); font-size:.9rem; white-space:nowrap; }
.cockpit-kpi b { font-size:1.22rem; line-height:1.05; font-weight:900; white-space:nowrap; font-variant-numeric:tabular-nums; }
.daily-report-card { margin: .85rem 0 .8rem; padding: .95rem 1rem; border-radius: 16px; border: 1px solid rgba(251,191,36,.25); background: linear-gradient(135deg, rgba(251,191,36,.16), rgba(59,130,246,.10)); box-shadow: 0 16px 44px rgba(0,0,0,.18); }
.daily-report-head { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:.45rem; }
.daily-report-head span { font-size:.92rem; font-weight:900; color:#fef3c7; }
.daily-report-head button { border:1px solid rgba(255,255,255,.14); background:rgba(255,255,255,.08); color:#fff; border-radius:999px; padding:.34rem .68rem; font-size:.72rem; cursor:pointer; }
.daily-report-text { font-size:.82rem; line-height:1.5; color:#f8fafc; }

/* 日报 UI 逐行渲染：和微信推送 plainText 每字对齐 */
.rpt-l { padding: .12rem 0; color:#e5e7eb; font-size:.86rem; line-height:1.55; white-space: pre-wrap; }
.rpt-l-header { color:#fbbf24; font-size:.95rem; font-weight:900; letter-spacing:.02em; padding-bottom:.35rem; border-bottom:1px solid rgba(255,255,255,.06); margin-bottom:.35rem; }
.rpt-l-title { color:#fbbf24; font-weight:900; padding-top:.3rem; padding-bottom:.1rem; }
.rpt-preview-wrap { padding:.75rem .9rem .85rem; border-radius:10px; background:rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.06); height:100%; }
.rpt-preview-head { font-size:.72rem; color:#94a3b8; font-weight:700; margin-bottom:.5rem; letter-spacing:.02em; }
.rpt-preview-body { border-left:2px solid rgba(251,191,36,.35); padding-left:.7rem; }

/* 日报卡内左右分栏：宽屏 左大屏视觉 | 右推送预览。左侧撑满右侧高度不留空 */
.rpt-layout { display:grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap:.9rem; align-items:stretch; }
.rpt-layout-left, .rpt-layout-right { min-width:0; display:flex; flex-direction:column; }
.rpt-layout-left > .rpt-be { margin-bottom:.7rem; flex:0 0 auto; }
.rpt-layout-left > .rpt-kpi { flex:1 1 auto; display:flex; flex-direction:column; justify-content:space-between; margin-bottom:0; }
.rpt-layout-left > .rpt-kpi .rpt-kpi-row { margin-bottom:0; }
.rpt-layout-left > .rpt-kpi .rpt-kpi-item { padding:.72rem .7rem; display:flex; flex-direction:column; justify-content:center; }
.rpt-layout-right > .rpt-preview-wrap { flex:1 1 auto; }
@media (max-width: 900px) {
    .rpt-layout { grid-template-columns: 1fr; }
    .rpt-layout-left, .rpt-layout-right { display:block; }
    .rpt-layout-left > .rpt-kpi { display:block; }
}

.rpt-section { margin-bottom:.65rem; }
.rpt-section:last-child { margin-bottom:0; }

/* 保本 hero 条：日报第一眼看到 昨日 vs 保本日均 */
.rpt-be { padding:.9rem 1.1rem 1rem; border-radius:12px; margin-bottom:.9rem;
    background: linear-gradient(135deg, rgba(251,191,36,.14), rgba(15,23,42,.15));
    border:1px solid rgba(251,191,36,.35); }
.rpt-be--ok  { background: linear-gradient(135deg, rgba(16,185,129,.16), rgba(15,23,42,.15)); border-color: rgba(16,185,129,.45); }
.rpt-be--warn{ background: linear-gradient(135deg, rgba(251,191,36,.15), rgba(15,23,42,.15)); border-color: rgba(251,191,36,.45); }
.rpt-be--bad { background: linear-gradient(135deg, rgba(239,68,68,.16),  rgba(15,23,42,.15)); border-color: rgba(239,68,68,.45); }
.rpt-be-row { display:flex; align-items:baseline; gap:1rem; flex-wrap:wrap; }
.rpt-be-side { display:flex; flex-direction:column; }
.rpt-be-side--pct { margin-left:auto; align-items:flex-end; }
.rpt-be-lbl { font-size:.7rem; color:#94a3b8; font-weight:800; margin-bottom:.15rem; }
.rpt-be-num { font-size:1.55rem; font-weight:900; color:#f8fafc; letter-spacing:-.5px; line-height:1; }
.rpt-be-pct { color:#fbbf24; }
.rpt-be--ok  .rpt-be-pct { color:#10b981; }
.rpt-be--warn.rpt-be-pct, .rpt-be--warn .rpt-be-pct { color:#fbbf24; }
.rpt-be--bad .rpt-be-pct { color:#ef4444; }
.rpt-be-bar-wrap { margin-top:.55rem; }
.rpt-be-bar-track { position:relative; height:8px; border-radius:6px; background:rgba(255,255,255,.08); overflow:hidden; }
.rpt-be-bar-fill { height:100%; border-radius:6px; background: linear-gradient(90deg, #fbbf24, #f59e0b); transition: width .3s ease; }
.rpt-be--ok  .rpt-be-bar-fill { background: linear-gradient(90deg, #10b981, #34d399); }
.rpt-be--bad .rpt-be-bar-fill { background: linear-gradient(90deg, #ef4444, #f87171); }
.rpt-be-bar-goal { position:absolute; top:0; left:100%; width:2px; height:100%; background:rgba(255,255,255,.35); transform:translateX(-1px); }
.rpt-be-foot { margin-top:.4rem; font-size:.8rem; color:#cbd5e1; font-weight:700; }
.rpt-be-foot b { color:#fbbf24; font-weight:900; }
.rpt-be--ok  .rpt-be-foot b { color:#10b981; }
.rpt-be--bad .rpt-be-foot b { color:#ef4444; }

.rpt-kpi-row { display:flex; gap:.5rem; margin-bottom:.4rem; flex-wrap:wrap; }
.rpt-kpi-item { flex:1; min-width:0; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.08); border-radius:10px; padding:.45rem .55rem; text-align:center; }
.rpt-kpi-item span { display:block; font-size:.65rem; color:rgba(255,255,255,.5); margin-bottom:.15rem; }
.rpt-num { color:#fbbf24; font-weight:800; font-size:.86rem; }
.rpt-insight { display:flex; align-items:flex-start; gap:.45rem; padding:.3rem 0; font-size:.78rem; line-height:1.45; color:rgba(255,255,255,.85); }
.rpt-emoji { flex: 0 0 auto; }
.rpt-dot { flex-shrink:0; width:6px; height:6px; border-radius:50%; background:#60a5fa; margin-top:.4rem; }
.rpt-dot.rpt-good { background:#34d399; }
.rpt-dot.rpt-warn { background:#fb923c; }
.cockpit-module-grid { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:.6rem; }
.cockpit-row { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:.6rem; margin-bottom:.6rem; }
.cockpit-col { min-width:0; }
.cockpit-col .cockpit-mini-card { height:100%; }
.cockpit-mini-card { border:1px solid rgba(255,255,255,.08); background:rgba(255,255,255,.022); border-radius:12px; padding:.65rem .75rem; min-height:92px; }
.cockpit-mini-card h3 { margin:0 0 .45rem; font-size:.82rem; font-weight:800; color:var(--text-primary); }
.cockpit-mini-card summary { cursor:pointer; display:flex; align-items:center; justify-content:space-between; gap:.5rem; list-style:none; font-size:.82rem; font-weight:800; }
.cockpit-mini-card summary::-webkit-details-marker { display:none; }
.cockpit-mini-card summary b { color:#fbbf24; font-size:.78rem; }
.cockpit-wage-card { width:100%; text-align:left; cursor:pointer; display:grid; grid-template-columns:1fr auto; align-items:center; gap:.35rem .75rem; color:inherit; font-family:inherit; }
.cockpit-wage-card span { font-size:.82rem; font-weight:800; }
.cockpit-wage-card b { color:#fbbf24; font-size:.86rem; }
.cockpit-wage-card em { grid-column:1 / -1; font-style:normal; color:var(--text-secondary); font-size:.68rem; }
.mgmt-mini-row { display:flex; align-items:center; justify-content:space-between; gap:.6rem; padding:.32rem 0; margin:0; border:0; border-bottom:1px solid rgba(255,255,255,.06); background:transparent; border-radius:0; }
.mgmt-mini-row-top { flex:1; min-width:0; display:flex; align-items:center; gap:.35rem; justify-content:flex-start; font-size:.72rem; }
.mgmt-mini-row-top strong { font-size:.76rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mgmt-mini-row-top span { font-size:.68rem; color:var(--text-secondary); white-space:nowrap; }
.mgmt-mini-row-amount { margin:0; font-size:.76rem; font-weight:800; white-space:nowrap; font-variant-numeric:tabular-nums; }
.wage-modal { position:fixed; inset:0; z-index:1000; display:flex; align-items:center; justify-content:center; padding:1.5rem; background:rgba(2,6,23,.58); backdrop-filter:blur(14px); }
.wage-modal.hidden { display:none; }
.wage-modal-panel { width:min(1280px, 96vw); max-height:88vh; overflow:hidden; display:flex; flex-direction:column; border-radius:20px; border:1px solid rgba(255,255,255,.14); background:#111827; box-shadow:0 28px 90px rgba(0,0,0,.42); }
.wage-modal-head { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:1rem 1.15rem; border-bottom:1px solid rgba(255,255,255,.09); }
.wage-modal-head h3 { margin:0; font-size:1.05rem; }
.wage-modal-head p { margin:.22rem 0 0; color:var(--text-secondary); font-size:.76rem; }
.wage-modal-head button { width:34px; height:34px; border-radius:999px; border:1px solid rgba(255,255,255,.12); background:rgba(255,255,255,.04); color:#fff; font-size:1.2rem; cursor:pointer; }
.wage-toolbar { display:flex; align-items:center; gap:.45rem; padding:.75rem 1.15rem; flex-wrap:wrap; font-size:.76rem; border-bottom:1px solid rgba(255,255,255,.08); }
.wage-toolbar .filter-input { padding:.42rem .55rem; border-radius:8px; max-width:120px; }
.wage-toolbar button { padding:.42rem .65rem !important; font-size:.74rem !important; border-radius:8px !important; }
.wage-toolbar-total { margin-left:auto; color:var(--text-secondary); }
.wage-toolbar-total b { color:#fbbf24; }
.wage-table-wrap { padding: .85rem 1.15rem 1.1rem; overflow:auto; }
.wage-table-wrap .data-table { font-size:.74rem; }
.wage-table-wrap input { font-size:.74rem !important; padding:.36rem !important; min-width:70px !important; }
@media (max-width: 1400px) { .cockpit-kpi-strip { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 1100px) { .cockpit-module-grid { grid-template-columns:1fr; } .cockpit-kpi-strip { grid-template-columns: repeat(2, minmax(0,1fr)); } }
/* Reconciliation modules unified */
.reconcile-three-column-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; align-items: start; }
.reconcile-column { display: flex; flex-direction: column; gap: 0.75rem; }
.recon-section { border-radius: 14px; padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.recon-section-title { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.7rem 1rem; margin: 0; font-size: 0.88rem; font-weight: 800; border-bottom: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03); }
.recon-section-title .badge { font-size: 0.78rem; font-weight: 700; padding: 0.2rem 0.55rem; border-radius: 999px; background: rgba(255,255,255,.06); }
.recon-section-body { padding: 0.75rem 1rem; display: flex; flex-direction: column; gap: 0.6rem; }
.recon-scroll-list { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 0.45rem; }
.recon-date-strip { display: flex; justify-content: space-between; align-items: center; padding: 0.55rem 0.7rem; border-radius: 10px; background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.18); font-size: 0.78rem; }
.recon-date-strip strong { color: #fbbf24; font-family: var(--font-mono); }
.recon-input-area { position: relative; }
.recon-input-area textarea { width: 100%; min-height: 80px; resize: vertical; border-radius: 10px; padding: 0.65rem; font-size: 0.82rem; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); color: #fff; }
.recon-hint { font-size: 0.72rem; color: rgba(255,255,255,.45); }
.recon-cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.recon-mini-card { padding: 0.65rem; border-radius: 10px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.07); }
.recon-mini-card h5 { margin: 0 0 0.35rem; font-size: 0.78rem; font-weight: 700; opacity: 0.8; color: #a78bfa; }
.recon-mini-row { display: flex; justify-content: space-between; font-size: 0.78rem; margin-bottom: 0.12rem; }
.recon-mini-row.total { font-weight: 800; font-size: 0.82rem; margin-top: 0.2rem; }
.recon-mini-divider { height: 1px; background: rgba(255,255,255,.08); margin: 0.3rem 0; }
.recon-copy-btns { display: flex; align-items: center; gap: 0.45rem; font-size: 0.72rem; color: rgba(255,255,255,.5); }
.recon-copy-btns .btn { padding: 2px 6px; font-size: 0.72rem; }
.recon-chip-row { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.recon-chip { padding: 0.3rem 0.6rem; border-radius: 999px; font-size: 0.72rem; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.03); color: #fff; cursor: pointer; }
.recon-chip.active { background: rgba(96,165,250,.22); border-color: rgba(96,165,250,.45); }
.recon-expand-btn { padding: 2px 8px; font-size: 12px; line-height: 1; }
.periodic-month-chip { background: rgba(167,139,250,.06); border-color: rgba(167,139,250,.18); }
.periodic-month-chip.active { background: rgba(167,139,250,.28); border-color: rgba(167,139,250,.55); }
.periodic-select-all-row { display: flex; align-items: center; justify-content: flex-end; gap: 0.35rem; font-size: 0.72rem; color: rgba(255,255,255,.65); cursor: pointer; user-select: none; }
.periodic-select-all-row input[type="checkbox"] { width: 14px; height: 14px; cursor: pointer; margin: 0; }
.periodic-expand-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 999; }
/* 定期结算专区放大浮层：只在展开态生效，不影响三栏正常布局的高度/对齐 */
#tab-reconciliation-center .reconcile-column > .recon-section.periodic-section-expanded {
    position: fixed !important;
    top: 6vh !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: min(760px, 92vw) !important;
    height: 84vh !important;
    max-height: 84vh !important;
    z-index: 1000 !important;
    box-shadow: 0 24px 64px rgba(0,0,0,.55) !important;
}
@media (max-width: 900px) {
    #tab-reconciliation-center .reconcile-column > .recon-section.periodic-section-expanded {
        width: 94vw !important;
        height: 88vh !important;
        max-height: 88vh !important;
    }
}
.recon-stats-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.recon-stat-item { text-align: center; padding: 0.5rem; border-radius: 10px; background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.06); }
.recon-stat-item span { display: block; font-size: 0.68rem; color: rgba(255,255,255,.5); margin-bottom: 0.2rem; }
.recon-stat-item b { font-size: 0.85rem; font-weight: 800; }
.recon-filter-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.72rem; color: rgba(255,255,255,.6); }
.recon-filter-row strong { color: #fff; }
.recon-filter-row .btn { padding: 2px 8px; font-size: 0.72rem; }

/* Final reconciliation alignment: fixed row heights and real left-aligned titles */
#tab-reconciliation-center .reconcile-three-column-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0.75rem !important;
    align-items: start !important;
}
#tab-reconciliation-center .reconcile-column {
    display: grid !important;
    grid-template-rows: 430px 430px 320px !important;
    gap: 0.75rem !important;
    align-items: stretch !important;
}
#tab-reconciliation-center .reconcile-column > * {
    flex: none !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
}
#tab-reconciliation-center .recon-section {
    height: 100% !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
    border-radius: 14px !important;
}
#tab-reconciliation-center .recon-section-title {
    height: 64px !important;
    min-height: 64px !important;
    padding: 0 1.1rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.65rem !important;
    text-align: left !important;
    font-size: 1rem !important;
    line-height: 1 !important;
    font-weight: 800 !important;
    letter-spacing: 0 !important;
}
#tab-reconciliation-center .recon-section-title i,
#tab-reconciliation-center .recon-section-title .fa-solid {
    width: 22px !important;
    min-width: 22px !important;
    text-align: center !important;
}
#tab-reconciliation-center .recon-section-title .badge {
    margin-left: auto !important;
}
#tab-reconciliation-center .recon-section-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    padding: 1rem 1.1rem !important;
}
#tab-reconciliation-center .recon-scroll-list,
#tab-reconciliation-center #ledger-items-container,
#tab-reconciliation-center #sys-details-scroll,
#tab-reconciliation-center #periodic-outstanding-list,
#tab-reconciliation-center #periodic-writeoff-list,
#tab-reconciliation-center #historical-checks-list,
#tab-reconciliation-center #periodic-supplier-chips {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
}
#tab-reconciliation-center .recon-cards-3 {
    height: 100% !important;
    align-items: stretch !important;
}
#tab-reconciliation-center .recon-mini-card {
    min-height: 0 !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
}
#tab-reconciliation-center .recon-input-area textarea {
    height: 150px !important;
    min-height: 150px !important;
    resize: none !important;
}
#tab-reconciliation-center .reimb-summary-copy-box {
    background: rgba(255,255,255,0.05) !important;
    border-radius: 10px !important;
    padding: 0.75rem !important;
    margin: 0 !important;
}
#tab-reconciliation-center .reimb-summary-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 0.45rem !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
}
#tab-reconciliation-center .reimb-summary-totals {
    display: flex !important;
    gap: 0.75rem !important;
    flex-wrap: wrap !important;
    font-size: 0.8rem !important;
}
#tab-reconciliation-center .recon-date-strip,
#tab-reconciliation-center .btn-group-toggle,
#tab-reconciliation-center .recon-input-area,
#tab-reconciliation-center .recon-hint,
#tab-reconciliation-center #btn-parse-manual,
#tab-reconciliation-center .recon-copy-btns,
#tab-reconciliation-center .recon-chip-row,
#tab-reconciliation-center .recon-stats-2,
#tab-reconciliation-center .recon-filter-row {
    flex: 0 0 auto !important;
}
@media (max-width: 1400px) {
    #tab-reconciliation-center .reconcile-three-column-grid { grid-template-columns: 1fr !important; }
    #tab-reconciliation-center .reconcile-column { grid-template-rows: none !important; }
    #tab-reconciliation-center .recon-section { height: 420px !important; }
}

/* Reconciliation v1.3.2: compact comparison rows, remove helper text/date/writeoff module */
#tab-reconciliation-center .recon-date-strip,
#tab-reconciliation-center .recon-hint {
    display: none !important;
}
#tab-reconciliation-center .recon-cards-3 {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: repeat(3, minmax(0, 1fr)) !important;
    gap: 0.65rem !important;
    height: 100% !important;
}
#tab-reconciliation-center .recon-mini-card {
    height: auto !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: 96px repeat(5, minmax(0, 1fr)) !important;
    align-items: center !important;
    column-gap: 0.55rem !important;
    row-gap: 0.25rem !important;
    padding: 0.7rem 0.8rem !important;
}
#tab-reconciliation-center .recon-mini-card h5 {
    margin: 0 !important;
    font-size: 0.86rem !important;
    line-height: 1.2 !important;
    color: #a78bfa !important;
    opacity: 1 !important;
    white-space: nowrap !important;
}
#tab-reconciliation-center .recon-mini-divider {
    display: none !important;
}
#tab-reconciliation-center .recon-mini-row {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 0.12rem !important;
    margin: 0 !important;
    min-width: 0 !important;
}
#tab-reconciliation-center .recon-mini-row span {
    font-size: 0.66rem !important;
    line-height: 1 !important;
    color: rgba(255,255,255,.48) !important;
    white-space: nowrap !important;
}
#tab-reconciliation-center .recon-mini-row b {
    font-size: 0.82rem !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
}
#tab-reconciliation-center .recon-mini-row.total b {
    color: #f8fafc !important;
}
#tab-reconciliation-center .recon-input-area textarea {
    height: 185px !important;
    min-height: 185px !important;
}
#tab-reconciliation-center .recon-copy-btns > span {
    display: none !important;
}
#tab-reconciliation-center .recon-copy-btns {
    justify-content: flex-start !important;
}
@media (max-width: 1500px) {
    #tab-reconciliation-center .recon-mini-card {
        grid-template-columns: 88px repeat(3, minmax(0, 1fr)) !important;
    }
}

/* Reconciliation v1.3.3: refine comparison + periodic modules */
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-section-body,
#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-section:first-child .recon-section-body {
    padding: 1rem 1.05rem !important;
}

/* 系统比对：3 条横向信息行，减少空白 */
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-cards-3 {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: repeat(3, minmax(0, 1fr)) !important;
    gap: 0.75rem !important;
    height: 100% !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-card {
    display: grid !important;
    grid-template-columns: 7.5rem repeat(5, minmax(4.8rem, 1fr)) !important;
    align-items: center !important;
    gap: 0.5rem !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0.85rem 1rem !important;
    border-radius: 14px !important;
    background: rgba(255,255,255,.035) !important;
    border: 1px solid rgba(255,255,255,.08) !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-card h5 {
    margin: 0 !important;
    font-size: 0.95rem !important;
    line-height: 1.2 !important;
    color: #a78bfa !important;
    opacity: 1 !important;
    white-space: nowrap !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-divider { display: none !important; }
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-row {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: flex-start !important;
    gap: 0.18rem !important;
    margin: 0 !important;
    min-width: 0 !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-row span {
    font-size: 0.68rem !important;
    line-height: 1 !important;
    color: rgba(255,255,255,.46) !important;
    white-space: nowrap !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-row b {
    font-size: 0.9rem !important;
    line-height: 1.1 !important;
    color: #f8fafc !important;
    white-space: nowrap !important;
    font-family: var(--font-mono) !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-row.total b { color: #ffffff !important; }

/* 定期结算：去掉大色块感，变成筛选/汇总/列表三段 */
#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-section:first-child .recon-section-body {
    display: grid !important;
    grid-template-rows: auto auto auto 1fr !important;
    gap: 0.75rem !important;
}
#tab-reconciliation-center #periodic-category-chips {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 0.5rem !important;
    overflow-x: auto !important;
    padding-bottom: 0.05rem !important;
}
#tab-reconciliation-center #periodic-category-chips .recon-chip {
    flex: 0 0 auto !important;
    min-height: 34px !important;
    padding: 0 0.75rem !important;
    border-radius: 999px !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    background: rgba(255,255,255,.035) !important;
    border: 1px solid rgba(255,255,255,.10) !important;
    color: rgba(255,255,255,.8) !important;
}
#tab-reconciliation-center #periodic-category-chips .recon-chip.active {
    background: rgba(59,130,246,.20) !important;
    border-color: rgba(59,130,246,.55) !important;
    color: #fff !important;
}
#tab-reconciliation-center #periodic-supplier-chips {
    flex: none !important;
    min-height: 54px !important;
    max-height: 54px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 0.5rem !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip {
    flex: 0 0 9.5rem !important;
    min-width: 9.5rem !important;
    height: 54px !important;
    padding: 0.45rem 0.65rem !important;
    border-radius: 12px !important;
    text-align: left !important;
    background: rgba(255,255,255,.035) !important;
    border: 1px solid rgba(255,255,255,.10) !important;
    box-shadow: none !important;
}
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip.active {
    background: rgba(59,130,246,.16) !important;
    border-color: rgba(59,130,246,.55) !important;
}
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip strong {
    display: block !important;
    overflow: visible !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 0.82rem !important;
    line-height: 1.15 !important;
    margin: 0 0 0.25rem !important;
}
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip span {
    display: block !important;
    font-size: 0.7rem !important;
    line-height: 1 !important;
    opacity: .58 !important;
    white-space: nowrap !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-stats-2 {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    gap: 0.65rem !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-stat-item {
    padding: 0.65rem !important;
    border-radius: 12px !important;
    background: rgba(255,255,255,.03) !important;
    border: 1px solid rgba(255,255,255,.08) !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-filter-row {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    gap: 0.75rem !important;
    align-items: center !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-filter-row span {
    overflow: visible !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 0 !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-filter-row strong {
    font-size: 0.82rem !important;
    color: rgba(255,255,255,.82) !important;
}
#tab-reconciliation-center #btn-settle-periodic-filter {
    height: 34px !important;
    padding: 0 0.8rem !important;
    border-radius: 10px !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
}
#tab-reconciliation-center #periodic-outstanding-list {
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    border: 1px solid rgba(255,255,255,.08) !important;
    border-radius: 14px !important;
    padding: 0.55rem !important;
    background: rgba(255,255,255,.018) !important;
}
@media (max-width: 1500px) {
    #tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-card {
        grid-template-columns: 6.5rem repeat(3, minmax(4.6rem, 1fr)) !important;
    }
}

/* Reconciliation v1.3.4: text-only content, cockpit-style rows */
#tab-reconciliation-center .recon-section-body {
    background: transparent !important;
}

/* 系统比对：去掉内部色块，改成首页看板式文字行 */
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-cards-3 {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    height: 100% !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-card {
    display: grid !important;
    grid-template-columns: 8rem repeat(5, minmax(0, 1fr)) !important;
    align-items: center !important;
    gap: 0.75rem !important;
    flex: 1 1 0 !important;
    min-height: 0 !important;
    padding: 0.75rem 0 !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.08) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-card:last-child {
    border-bottom: 0 !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-card h5 {
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    color: #a78bfa !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-row span {
    font-size: 0.72rem !important;
    color: rgba(255,255,255,.48) !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-row b {
    font-size: 0.95rem !important;
    font-weight: 850 !important;
}

/* 定期结算：保留按钮，列表/供应商/统计去色块，改文字信息 */
#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-section:first-child .recon-section-body {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.7rem !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-stat-item {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0.2rem 0 !important;
    text-align: left !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-stat-item span {
    font-size: 0.72rem !important;
    color: rgba(255,255,255,.45) !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-stat-item b {
    font-size: 1rem !important;
    color: #f8fafc !important;
}
#tab-reconciliation-center #periodic-supplier-chips {
    flex: 0 0 auto !important;
    max-height: 74px !important;
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    gap: 0 !important;
}
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip {
    height: auto !important;
    min-height: 36px !important;
    flex: 0 0 auto !important;
    min-width: 8rem !important;
    padding: 0.35rem 0.65rem !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.08) !important;
    box-shadow: none !important;
}
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip.active {
    background: transparent !important;
    border-bottom-color: #3b82f6 !important;
    color: #fff !important;
}
#tab-reconciliation-center #periodic-outstanding-list {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding: 0 !important;
}
#tab-reconciliation-center #periodic-outstanding-list .detail-item-row,
#tab-reconciliation-center #sys-details-scroll .detail-item-row,
#tab-reconciliation-center #ledger-items-container .ledger-item-row,
#tab-reconciliation-center #historical-checks-list .history-check-row,
#tab-reconciliation-center #historical-checks-list > * {
    background: transparent !important;
    border-radius: 0 !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.08) !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0.65rem 0 !important;
}
#tab-reconciliation-center #periodic-outstanding-list .detail-item-row {
    border-left: 0 !important;
}
#tab-reconciliation-center .detail-item-row::before,
#tab-reconciliation-center .ledger-item-row::before {
    display: none !important;
}

/* Reconciliation v1.3.5: fix cramped comparison text and periodic supplier layout */
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-section-body {
    padding: 1rem 1.25rem !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-cards-3 {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-card {
    display: flex !important;
    align-items: center !important;
    gap: 1.1rem !important;
    padding: 1rem 0 !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.08) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    min-height: 0 !important;
    overflow: visible !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-card:last-child {
    border-bottom: 0 !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-card h5 {
    flex: 0 0 7.2rem !important;
    min-width: 7.2rem !important;
    margin: 0 !important;
    font-size: 0.98rem !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-row {
    flex: 0 0 4.95rem !important;
    width: 4.95rem !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 0.18rem !important;
    margin: 0 !important;
    overflow: visible !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-row span {
    width: 100% !important;
    overflow: visible !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 0.68rem !important;
    color: rgba(255,255,255,.50) !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-row b {
    width: 100% !important;
    overflow: visible !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 0.86rem !important;
    line-height: 1.1 !important;
    letter-spacing: -0.02em !important;
    font-family: var(--font-mono) !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-divider {
    display: none !important;
}

#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-section:first-child .recon-section-body {
    padding: 1rem 1.25rem !important;
    gap: 0.85rem !important;
}
#tab-reconciliation-center #periodic-supplier-chips {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0 1rem !important;
    max-height: 72px !important;
    min-height: 72px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
}
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip {
    width: 100% !important;
    min-width: 0 !important;
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    align-items: center !important;
    column-gap: 0.6rem !important;
    background: transparent !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.08) !important;
    border-left: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    color: #f8fafc !important;
}
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip.active {
    background: transparent !important;
    border-left: 0 !important;
    border-bottom-color: rgba(59,130,246,.65) !important;
    box-shadow: none !important;
}
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip strong {
    min-width: 0 !important;
    overflow: visible !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 0.9rem !important;
    line-height: 1 !important;
    margin: 0 !important;
}
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip span {
    overflow: visible !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 0.72rem !important;
    line-height: 1 !important;
    opacity: .58 !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-stats-2 {
    border-top: 1px solid rgba(255,255,255,.08) !important;
    border-bottom: 1px solid rgba(255,255,255,.08) !important;
    padding: 0.65rem 0 !important;
}
#tab-reconciliation-center #periodic-outstanding-list .detail-item-row {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    gap: 0.75rem !important;
    align-items: center !important;
    padding: 0.75rem 0 !important;
}

/* Reconciliation v1.3.6: readable text layout, no overlapping columns */
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-section-body {
    padding: 1rem 1.35rem !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-cards-3 {
    display: grid !important;
    grid-template-rows: repeat(3, minmax(0, 1fr)) !important;
    gap: 0 !important;
    height: 100% !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-card {
    display: grid !important;
    grid-template-columns: 8.5rem repeat(5, minmax(5.7rem, 1fr)) !important;
    align-items: center !important;
    column-gap: 1.05rem !important;
    padding: 0.75rem 0 !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.08) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-card:last-child { border-bottom: 0 !important; }
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-card h5 {
    min-width: 0 !important;
    margin: 0 !important;
    font-size: 0.98rem !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    color: #a78bfa !important;
    text-align: left !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-row {
    width: auto !important;
    min-width: 0 !important;
    flex: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 0.2rem !important;
    margin: 0 !important;
    overflow: visible !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-row span {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    overflow: visible !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 0.7rem !important;
    line-height: 1.1 !important;
    color: rgba(255,255,255,.48) !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-row b {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
    font-size: 0.86rem !important;
    line-height: 1.1 !important;
    letter-spacing: -0.04em !important;
    font-family: var(--font-mono) !important;
    color: #f8fafc !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-divider { display: none !important; }

#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-section:first-child .recon-section-body {
    display: grid !important;
    grid-template-rows: auto auto auto auto 1fr !important;
    gap: 0.8rem !important;
    padding: 1rem 1.35rem !important;
}
#tab-reconciliation-center #periodic-category-chips {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.55rem !important;
    overflow: visible !important;
}
#tab-reconciliation-center #periodic-supplier-chips {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0 1.25rem !important;
    min-height: 76px !important;
    max-height: 76px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    column-gap: 0.75rem !important;
    height: 38px !important;
    min-height: 38px !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-left: 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.08) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip.active {
    border-left: 0 !important;
    background: transparent !important;
    border-bottom-color: rgba(96,165,250,.7) !important;
}
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip strong {
    min-width: 0 !important;
    overflow: visible !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 0.88rem !important;
    line-height: 1 !important;
    margin: 0 !important;
}
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip span {
    overflow: visible !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 0.72rem !important;
    opacity: .58 !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-stats-2 {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    gap: 1.25rem !important;
    padding: 0.7rem 0 !important;
    border-top: 1px solid rgba(255,255,255,.08) !important;
    border-bottom: 1px solid rgba(255,255,255,.08) !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-filter-row {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) auto !important;
    align-items: center !important;
    gap: 0.8rem !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-filter-row span {
    font-size: 0 !important;
    min-width: 0 !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-filter-row strong {
    font-size: 0.9rem !important;
    white-space: nowrap !important;
}

/* Reconciliation v1.3.7: safe readable layout, no clipping / no inner color blocks */
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-section-body,
#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-section:first-child .recon-section-body {
    padding: 1rem 1.15rem !important;
}

/* 系统比对：每个人一行，指标自动换行，绝不裁切 */
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-cards-3 {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    gap: 0 !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-card {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
    padding: 0.85rem 0 !important;
    overflow: visible !important;
    background: transparent !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.10) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-card:last-child { border-bottom: 0 !important; }
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-card h5 {
    flex: 0 0 8.8rem !important;
    margin: 0 !important;
    color: #a78bfa !important;
    font-size: 1rem !important;
    line-height: 1.25 !important;
    font-weight: 900 !important;
    white-space: nowrap !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-divider { display: none !important; }
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-row {
    flex: 1 1 5.4rem !important;
    min-width: 5.4rem !important;
    max-width: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 0.18rem !important;
    margin: 0 !important;
    overflow: visible !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-row span {
    display: block !important;
    max-width: 100% !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
    color: rgba(255,255,255,.48) !important;
    font-size: 0.72rem !important;
    line-height: 1.1 !important;
    font-weight: 800 !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-row b {
    display: block !important;
    max-width: 100% !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
    color: #f8fafc !important;
    font-size: 0.92rem !important;
    line-height: 1.1 !important;
    letter-spacing: -0.03em !important;
    font-family: var(--font-mono) !important;
    font-weight: 900 !important;
}

/* 定期结算：供应商用文字筛选，不做色块，不截断 */
#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-section:first-child .recon-section-body {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.8rem !important;
    overflow: visible !important;
}
#tab-reconciliation-center #periodic-category-chips {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
    overflow: visible !important;
    flex: 0 0 auto !important;
}
#tab-reconciliation-center #periodic-category-chips .recon-chip {
    min-height: 34px !important;
    padding: 0 0.78rem !important;
    border-radius: 999px !important;
    background: transparent !important;
    border: 1px solid rgba(255,255,255,.14) !important;
    color: rgba(255,255,255,.82) !important;
    font-size: 0.82rem !important;
    font-weight: 800 !important;
}
#tab-reconciliation-center #periodic-category-chips .recon-chip.active {
    background: rgba(59,130,246,.16) !important;
    border-color: rgba(59,130,246,.55) !important;
    color: #fff !important;
}
#tab-reconciliation-center #periodic-supplier-chips {
    flex: 0 0 auto !important;
    min-height: 0 !important;
    max-height: 70px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-content: flex-start !important;
    gap: 0.45rem 1rem !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 0 0 0.25rem !important;
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
}
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip {
    flex: 0 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    display: inline-flex !important;
    align-items: baseline !important;
    gap: 0.45rem !important;
    padding: 0.2rem 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-left: 0 !important;
    border-bottom: 1px solid transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: rgba(255,255,255,.82) !important;
}
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip.active {
    background: transparent !important;
    border-left: 0 !important;
    border-bottom-color: #60a5fa !important;
    color: #fff !important;
}
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip strong {
    display: inline !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
    font-size: 0.86rem !important;
    line-height: 1.2 !important;
    margin: 0 !important;
}
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip span {
    display: inline !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
    font-size: 0.72rem !important;
    line-height: 1.2 !important;
    opacity: .55 !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-stats-2 {
    flex: 0 0 auto !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    gap: 1rem !important;
    padding: 0.65rem 0 !important;
    border-top: 1px solid rgba(255,255,255,.10) !important;
    border-bottom: 1px solid rgba(255,255,255,.10) !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-filter-row {
    flex: 0 0 auto !important;
    display: grid !important;
    grid-template-columns: minmax(0,1fr) auto !important;
    align-items: center !important;
    gap: 0.75rem !important;
}
#tab-reconciliation-center #periodic-outstanding-list {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
}

/* Reconciliation v1.3.8: final readable text layout after visual check */
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-section-body,
#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-section:first-child .recon-section-body {
    padding: 1rem 1.25rem !important;
}

/* 系统比对：标题 + 指标网格，允许换行，不裁切、不重叠 */
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-cards-3 {
    display: grid !important;
    grid-template-rows: repeat(3, minmax(0, 1fr)) !important;
    gap: 0 !important;
    height: 100% !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-card {
    display: grid !important;
    grid-template-columns: 8.6rem repeat(3, minmax(0, 1fr)) !important;
    grid-auto-rows: min-content !important;
    align-content: center !important;
    align-items: center !important;
    column-gap: 1.15rem !important;
    row-gap: 0.6rem !important;
    padding: 0.9rem 0 !important;
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
    background: transparent !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.10) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-card:last-child { border-bottom: 0 !important; }
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-card h5 {
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
    margin: 0 !important;
    align-self: center !important;
    color: #a78bfa !important;
    font-size: 1rem !important;
    line-height: 1.2 !important;
    font-weight: 900 !important;
    white-space: nowrap !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-divider { display: none !important; }
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-row {
    min-width: 0 !important;
    width: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.18rem !important;
    margin: 0 !important;
    overflow: visible !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-row span {
    display: block !important;
    max-width: 100% !important;
    overflow: visible !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 0.72rem !important;
    line-height: 1.1 !important;
    font-weight: 800 !important;
    color: rgba(255,255,255,.48) !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-row b {
    display: block !important;
    max-width: 100% !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
    font-size: 0.9rem !important;
    line-height: 1.1 !important;
    letter-spacing: -0.03em !important;
    font-family: var(--font-mono) !important;
    font-weight: 900 !important;
    color: #f8fafc !important;
}

/* 定期结算：去掉供应商双列，改成完整文字列表 */
#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-section:first-child .recon-section-body {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.8rem !important;
    overflow: visible !important;
}
#tab-reconciliation-center #periodic-category-chips {
    flex: 0 0 auto !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
    overflow: visible !important;
}
#tab-reconciliation-center #periodic-supplier-chips {
    flex: 0 0 78px !important;
    min-height: 78px !important;
    max-height: 78px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
}
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip {
    flex: 0 0 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 39px !important;
    min-height: 39px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-left: 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.10) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: rgba(255,255,255,.86) !important;
}
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip.active {
    background: transparent !important;
    border-left: 0 !important;
    border-bottom-color: rgba(96,165,250,.65) !important;
}
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip strong {
    min-width: 0 !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
    font-size: 0.9rem !important;
    line-height: 1 !important;
    margin: 0 !important;
}
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip span {
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
    font-size: 0.74rem !important;
    line-height: 1 !important;
    opacity: .58 !important;
}

/* Reconciliation v1.3.10: remove leftover supplier color rail */
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip::before,
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip::after {
    display: none !important;
    content: none !important;
}
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip,
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip.active,
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip.all.active,
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip.fish.active,
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip.frog.active,
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip.frozen.active,
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip.other.active {
    border-left: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* Reconciliation v1.3.11: comparison title as compact subheading */
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-card {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    grid-auto-rows: min-content !important;
    align-content: center !important;
    row-gap: 0.5rem !important;
    column-gap: 1rem !important;
    padding: 0.75rem 0 !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-card h5 {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    align-self: auto !important;
    margin: 0 !important;
    font-size: 0.9rem !important;
    line-height: 1.1 !important;
    font-weight: 900 !important;
    color: #a78bfa !important;
    white-space: nowrap !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-row {
    min-width: 0 !important;
}

/* Reconciliation v1.3.13: put reimbursement/settlement status on second line */
#tab-reconciliation-center #sys-details-scroll .detail-item-row .info {
    min-width: 0 !important;
}
#tab-reconciliation-center #sys-details-scroll .detail-item-row .meta {
    display: block !important;
    line-height: 1.35 !important;
}
#tab-reconciliation-center #sys-details-scroll .detail-item-row .status-line {
    margin-top: 0.18rem !important;
    padding-left: 0 !important;
    font-weight: 800 !important;
}

/* Income analysis v1.3.14: copy 3015 visual structure */
#tab-income-analysis .income-shell {
    max-width: 1100px;
    margin: 0 auto;
    gap: 12px;
}
#tab-income-analysis .income-tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 0;
    border: 0;
    background: transparent !important;
    box-shadow: none !important;
}
#tab-income-analysis .tab-title,
#tab-income-analysis .income-tab-header h2 {
    font-size: 10px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary, #e2e8f0);
}
#tab-income-analysis .tab-meta,
#tab-income-analysis .income-tab-header p {
    font-size: 10px;
    color: var(--text-secondary, #94a3b8);
    margin-top: 2px;
}
#tab-income-analysis .income-kpi-grid,
#tab-income-analysis .kpi-grid-6 {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 12px !important;
    margin-bottom: 12px !important;
}
#tab-income-analysis .kpi {
    background: rgba(30, 41, 59, 0.92);
    border: 1px solid rgba(51, 65, 85, 0.95);
    border-radius: 10px;
    padding: 12px;
}
#tab-income-analysis .kpi-label {
    font-size: 10px;
    color: var(--text-secondary, #94a3b8);
    margin-bottom: 4px;
}
#tab-income-analysis .kpi-value {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-primary, #e2e8f0);
    line-height: 1.15;
}
#tab-income-analysis .kpi-sub {
    font-size: 10px;
    color: var(--text-secondary, #94a3b8);
    margin-top: 2px;
}
#tab-income-analysis .card-block {
    background: rgba(30, 41, 59, 0.92) !important;
    border: 1px solid rgba(51, 65, 85, 0.95) !important;
    border-radius: 10px !important;
    padding: 14px !important;
    margin-bottom: 12px !important;
    box-shadow: none !important;
}
#tab-income-analysis .card-block h3 {
    font-size: 10px;
    margin: 0 0 10px;
    color: var(--text-primary, #e2e8f0);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
#tab-income-analysis .card-block h3 .tag {
    font-size: 10px;
    background: rgba(39, 52, 73, 0.95);
    color: var(--text-secondary, #94a3b8);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}
#tab-income-analysis .income-conclusion {
    border-left: 4px solid #38bdf8 !important;
}
#tab-income-analysis .income-conclusion h3 {
    color: #38bdf8;
}
#tab-income-analysis .income-real-cash-card { border-left: 3px solid #10b981 !important; }
#tab-income-analysis .income-real-cash-card h3 { color: #34d399 !important; }
#tab-income-analysis .income-real-cash-summary { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.8rem; margin-bottom:.8rem; }
#tab-income-analysis .income-real-cash-total { padding:.8rem .9rem; border:1px solid rgba(251,191,36,.25); border-radius:10px; background:rgba(251,191,36,.06); }
#tab-income-analysis .income-real-cash-total.primary { border-color:rgba(16,185,129,.35); background:rgba(16,185,129,.07); }
#tab-income-analysis .income-real-cash-total small { display:block; color:rgba(255,255,255,.62); font-size:.7rem; }
#tab-income-analysis .income-real-cash-total strong { display:block; color:#34d399; font-size:1.25rem; margin:.2rem 0; }
#tab-income-analysis .income-real-cash-total span, #tab-income-analysis .income-real-cash-note { color:rgba(255,255,255,.58); font-size:.68rem; }
#tab-income-analysis .income-real-cash-row { display:grid; grid-template-columns:minmax(130px,1.5fr) repeat(2,minmax(100px,1fr)) 80px; gap:.5rem; align-items:center; padding:.46rem .2rem; border-bottom:1px solid rgba(255,255,255,.06); font-size:.72rem; }
#tab-income-analysis .income-real-cash-row.head { color:rgba(255,255,255,.5); font-size:.66rem; }
#tab-income-analysis .income-real-cash-row span { display:flex; align-items:center; gap:.45rem; }
#tab-income-analysis .income-real-cash-row span i { width:7px; height:7px; border-radius:50%; display:inline-block; }
#tab-income-analysis .income-real-cash-row b { text-align:right; color:#f8fafc; }
#tab-income-analysis .income-real-cash-row em { text-align:right; color:#34d399; font-style:normal; }
#tab-income-analysis .income-real-cash-judgement { margin-top:.75rem; padding:.65rem .75rem; border-left:2px solid #fbbf24; background:rgba(251,191,36,.06); color:rgba(255,255,255,.72); font-size:.7rem; line-height:1.55; }
#tab-income-analysis .income-real-cash-judgement b { color:#fbbf24; }
#tab-income-analysis .income-real-cash-note { margin-top:.65rem; line-height:1.5; }

/* Income analysis final layout override: seven cards use two readable rows on desktop. */
#tab-income-analysis #income-kpis.income-kpi-grid { display:grid !important; grid-template-columns:repeat(4, minmax(0, 1fr)) !important; gap:1rem !important; }
@media (max-width: 900px) {
    #tab-income-analysis #income-kpis.income-kpi-grid { grid-template-columns:repeat(2, minmax(0, 1fr)) !important; gap:.65rem !important; }
}

/* Income analysis readability: enlarge the seven KPI cards and their detail rows. */
#tab-income-analysis #income-kpis.income-kpi-grid .comp-card { min-height:260px !important; padding:1.15rem 1.2rem !important; }
#tab-income-analysis #income-kpis.income-kpi-grid .comp-card > div:first-child span { font-size:.92rem !important; }
#tab-income-analysis #income-kpis.income-kpi-grid .comp-card > div:first-child span i { font-size:.86rem !important; }
#tab-income-analysis #income-kpis.income-kpi-grid .comp-card > div:first-child > div:nth-child(2) { font-size:1.55rem !important; margin-top:.55rem !important; }
#tab-income-analysis #income-kpis.income-kpi-grid .comp-card > div:first-child > div:first-child > span:last-child { font-size:.74rem !important; padding:2px 7px !important; }
#tab-income-analysis #income-kpis.income-kpi-grid .comp-card > div:last-child { font-size:.82rem !important; padding:9px 10px !important; gap:5px !important; }
#tab-income-analysis #income-kpis.income-kpi-grid .comp-card > div:last-child > div { line-height:1.5 !important; }
#tab-income-analysis #income-kpis.income-kpi-grid .comp-card > div:last-child span { font-size:.82rem !important; }
#tab-income-analysis #income-kpis.income-kpi-grid .comp-card > div:last-child span:last-child { font-size:.84rem !important; }
#tab-income-analysis .income-real-cash-card .income-real-cash-total strong { font-size:1.45rem !important; }
#tab-income-analysis .income-real-cash-card .income-real-cash-total small,
#tab-income-analysis .income-real-cash-card .income-real-cash-row,
#tab-income-analysis .income-real-cash-card .income-real-cash-row.head { font-size:.8rem !important; }
#tab-income-analysis .income-real-cash-card .income-real-cash-note,
#tab-income-analysis .income-real-cash-card .income-real-cash-judgement { font-size:.78rem !important; }
#tab-income-analysis .income-conclusion .item {
    padding: 8px 0;
    border-bottom: 1px dashed rgba(51, 65, 85, 0.95);
}
#tab-income-analysis .income-conclusion .item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}
#tab-income-analysis .income-conclusion .item:first-child {
    padding-top: 0;
}
#tab-income-analysis .income-conclusion .q {
    font-weight: 600;
    color: var(--text-primary, #e2e8f0);
    margin-bottom: 4px;
    font-size: 10px;
}
#tab-income-analysis .income-conclusion .a {
    color: var(--text-secondary, #94a3b8);
    font-size: 12.5px;
    line-height: 1.6;
}
#tab-income-analysis .income-conclusion .rpt-section {
    margin-bottom: 0 !important;
}
#tab-income-analysis .income-conclusion .rpt-insight {
    font-size: 0.8rem !important;
    line-height: 1.65 !important;
    color: rgba(248,250,252,.86) !important;
    padding: 0.42rem 0 !important;
}
#tab-income-analysis .income-conclusion .rpt-num {
    color: #fbbf24 !important;
    font-weight: 900 !important;
}
#tab-income-analysis .income-analysis-section-title {
    margin: 1.15rem 0 0.75rem;
    padding: 0.72rem 0.9rem;
    border-left: 4px solid #38bdf8;
    background: linear-gradient(90deg, rgba(56,189,248,.14), rgba(255,255,255,.025));
    border-radius: 12px;
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}
#tab-income-analysis .income-analysis-section-title span {
    color: #e0f2fe;
    font-size: 0.95rem;
    font-weight: 900;
}
#tab-income-analysis .income-analysis-section-title small {
    color: rgba(226,232,240,.58);
    font-size: 0.72rem;
}
#tab-income-analysis #income-period-month-trend,
#tab-income-analysis #income-channel-month-trend,
#tab-income-analysis #income-mom-cards,
#tab-income-analysis #income-period-weekday-all,
#tab-income-analysis #income-month-weekday {
    overflow: visible !important;
    max-height: none !important;
    padding-right: 0 !important;
}
#tab-income-analysis .income-monthly-compare-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
#tab-income-analysis .income-monthly-compare-grid {
    align-items: start !important;
    grid-auto-rows: auto !important;
}
#tab-income-analysis .income-monthly-compare-grid .card-block {
    height: auto !important;
    min-height: 620px !important;
    max-height: none !important;
    overflow: visible !important;
}
#tab-income-analysis .income-monthly-compare-grid .card-block > div {
    overflow: visible !important;
    max-height: none !important;
    min-height: 0 !important;
}
#tab-income-analysis .income-monthly-compare-grid #income-month-trend {
    height: 520px !important;
    min-height: 520px !important;
}
#tab-income-analysis #income-period-month-trend .income-stack-rows,
#tab-income-analysis #income-channel-month-trend .income-stack-rows,
#tab-income-analysis #income-mom-cards .income-mom-rows {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
#tab-income-analysis .income-stack-legend {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-bottom: 0.65rem;
    color: rgba(226,232,240,.72);
    font-size: 0.72rem;
}
#tab-income-analysis .income-stack-legend span { display:flex; align-items:center; gap:.32rem; }
#tab-income-analysis .income-stack-legend i { width:10px; height:10px; border-radius:3px; display:inline-block; }
#tab-income-analysis .income-stack-row,
#tab-income-analysis .income-mom-row {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) 64px 52px;
    align-items: center;
    gap: 0.42rem;
    min-height: 30px;
}
#tab-income-analysis .income-stack-row { grid-template-columns: 62px minmax(0, 1fr); align-items:start; }
#tab-income-analysis .stack-month,
#tab-income-analysis .mom-month {
    color: #cbd5e1;
    font-weight: 800;
    font-size: 0.74rem;
    padding-top: 0.12rem;
}
#tab-income-analysis .stack-main { min-width: 0; }
#tab-income-analysis .stack-total {
    color: #fbbf24;
    font-weight: 900;
    font-size: 0.76rem;
    margin-bottom: 0.25rem;
}
#tab-income-analysis .stack-track,
#tab-income-analysis .mom-bar-wrap {
    height: 13px;
    background: rgba(255,255,255,.08);
    border-radius: 999px;
    overflow: hidden;
    display: flex;
    min-width: 6px;
}
#tab-income-analysis .stack-seg { height: 100%; min-width: 2px; }
#tab-income-analysis .stack-breakdown {
    display: flex;
    gap: 0.32rem;
    flex-wrap: wrap;
    margin-top: 0.22rem;
    font-size: 0.68rem;
}
#tab-income-analysis .stack-breakdown em { color: rgba(255,255,255,.25); font-style: normal; }
#tab-income-analysis .mom-bar { height:100%; border-radius:999px; background:linear-gradient(90deg,#38bdf8,#22c55e); }
#tab-income-analysis .income-mom-row b { color:#fbbf24; text-align:right; font-size:.74rem; }
#tab-income-analysis .income-mom-row em { font-style:normal; text-align:right; font-weight:900; font-size:.72rem; }
#tab-income-analysis .income-mom-row em.up { color:#34d399; }
#tab-income-analysis .income-mom-row em.down { color:#fb7185; }
#tab-income-analysis .income-mom-row em.flat { color:#94a3b8; }
#tab-income-analysis .income-heat-html {
    display: grid;
    gap: 5px;
    align-items: stretch;
    min-width: 520px;
}
#tab-income-analysis .heat-h,
#tab-income-analysis .heat-r,
#tab-income-analysis .heat-v {
    min-height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
}
#tab-income-analysis .heat-h { color: rgba(226,232,240,.58); }
#tab-income-analysis .heat-r { justify-content: flex-start; color:#cbd5e1; font-weight:900; background:rgba(255,255,255,.045); padding-left:.5rem; }
#tab-income-analysis .heat-v { color:#f8fafc; border:1px solid rgba(255,255,255,.05); }
#tab-income-analysis .heat-v span { transform: scale(.9); white-space: nowrap; }
#tab-income-analysis .income-rank-list,
#tab-income-analysis .income-month-weekday-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
#tab-income-analysis .income-rank-card {
    background: rgba(255,255,255,.045);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 12px;
    padding: 0.62rem;
}
#tab-income-analysis .rank-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .42rem;
}
#tab-income-analysis .rank-title b { color:#e0f2fe; font-size:.78rem; }
#tab-income-analysis .rank-title span { color:rgba(226,232,240,.55); font-size:.66rem; }
#tab-income-analysis .rank-main {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin-bottom: .45rem;
    font-weight: 900;
}
#tab-income-analysis .rank-main em { color:rgba(255,255,255,.35); font-style:normal; }
#tab-income-analysis .good { color:#34d399 !important; }
#tab-income-analysis .bad { color:#fb7185 !important; }
#tab-income-analysis .rank-bar-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 52px;
    gap: .4rem;
    align-items: center;
    margin-top: .28rem;
    font-size: .66rem;
}
#tab-income-analysis .rank-bar-row label { color:#cbd5e1; }
#tab-income-analysis .rank-bar-row div { height:7px; background:rgba(255,255,255,.08); border-radius:999px; overflow:hidden; }
#tab-income-analysis .rank-bar-row i { display:block; height:100%; background:linear-gradient(90deg,#38bdf8,#fbbf24); border-radius:999px; }
#tab-income-analysis .rank-bar-row b { color:#fbbf24; text-align:right; font-size:.65rem; }
#tab-income-analysis .month-weekday-row {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) minmax(0, 1fr) 58px;
    gap: .45rem;
    align-items: center;
    padding: .5rem .55rem;
    border-radius: 10px;
    background: rgba(255,255,255,.045);
    border: 1px solid rgba(255,255,255,.06);
    font-size: .68rem;
}
#tab-income-analysis .month-weekday-row span { color:#cbd5e1; font-weight:900; }
#tab-income-analysis .month-weekday-row b { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:.68rem; }
#tab-income-analysis .month-weekday-row em { color:#fbbf24; font-style:normal; text-align:right; font-weight:900; }
#tab-income-analysis .income-heat-matrix {
    display: grid;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
}
#tab-income-analysis .heat-head,
#tab-income-analysis .heat-row-title,
#tab-income-analysis .heat-cell {
    min-height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-size: 0.72rem;
}
#tab-income-analysis .heat-head {
    color: rgba(255,255,255,.5);
    justify-content: center;
}
#tab-income-analysis .heat-row-title {
    color: #fbbf24;
    font-weight: 800;
    background: rgba(255,255,255,.04);
}
#tab-income-analysis .heat-cell {
    justify-content: flex-end;
    color: #e5e7eb;
    border: 1px solid rgba(255,255,255,.06);
}
#tab-income-analysis .analysis-grid {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
}
#tab-income-analysis .analysis-grid.grid-3 {
    grid-template-columns: 1fr !important;
}
#tab-income-analysis .analysis-row,
#tab-income-analysis [id^="income-"] > div[style*="display:flex"] {
    border-bottom: 1px solid rgba(255,255,255,.08) !important;
}
@media (max-width: 900px) {
    #tab-income-analysis .income-kpi-grid,
    #tab-income-analysis .kpi-grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

#tab-income-analysis #income-month-trend { min-height: 280px !important; height: 340px !important; width: 100% !important; }

/* Income analysis v1.3.15: compact small-font multi-column layout */
#tab-income-analysis .income-shell {
    max-width: none !important;
    margin: 0 !important;
    gap: 1rem !important;
}
#tab-income-analysis .income-tab-header {
    padding: 1rem 1.2rem !important;
    border: 1px solid rgba(255,255,255,.10) !important;
    border-radius: 18px !important;
    background: rgba(255,255,255,.035) !important;
}
#tab-income-analysis .tab-title,
#tab-income-analysis .income-tab-header h2 {
    font-size: .92rem !important;
}
#tab-income-analysis .tab-meta,
#tab-income-analysis .income-tab-header p {
    font-size: .72rem !important;
}
#tab-income-analysis .income-kpi-grid,
#tab-income-analysis .kpi-grid-6 {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 1rem !important;
    margin-bottom: 1rem !important;
}
#tab-income-analysis .kpi {
    border-radius: 14px !important;
    padding: .9rem 1rem !important;
    background: rgba(255,255,255,.035) !important;
    border: 1px solid rgba(255,255,255,.10) !important;
}
#tab-income-analysis .kpi-label {
    font-size: .7rem !important;
    margin-bottom: .35rem !important;
}
#tab-income-analysis .kpi-value {
    font-size: .92rem !important;
    font-weight: 800 !important;
}
#tab-income-analysis .kpi-sub {
    font-size: .65rem !important;
}
#tab-income-analysis .card-block {
    border-radius: 16px !important;
    padding: 1rem 1.1rem !important;
    margin-bottom: 0 !important;
    background: rgba(255,255,255,.035) !important;
    border: 1px solid rgba(255,255,255,.10) !important;
}
#tab-income-analysis .card-block h3 {
    font-size: .95rem !important;
    margin-bottom: .75rem !important;
}
#tab-income-analysis .card-block h3 .tag {
    font-size: .72rem !important;
}
#tab-income-analysis .income-conclusion {
    border-left: 3px solid #38bdf8 !important;
}
#tab-income-analysis .income-conclusion .q {
    font-size: .84rem !important;
}
#tab-income-analysis .income-conclusion .a {
    font-size: .72rem !important;
}
#tab-income-analysis .analysis-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1rem !important;
}
#tab-income-analysis .analysis-grid.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
#tab-income-analysis .analysis-row,
#tab-income-analysis .analysis-group-title,
#tab-income-analysis #income-conclusions,
#tab-income-analysis [id^="income-"] {
    font-size: .72rem !important;
}
#tab-income-analysis .analysis-row b,
#tab-income-analysis [id^="income-"] b {
    font-size: .76rem !important;
}
@media (max-width: 1280px) {
    #tab-income-analysis .income-kpi-grid,
    #tab-income-analysis .kpi-grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    #tab-income-analysis .analysis-grid,
    #tab-income-analysis .analysis-grid.grid-3 { grid-template-columns: 1fr !important; }
}

/* Analysis v1.3.16: equal-height cards with internal scroll for income only */
#tab-income-analysis .analysis-grid {
    align-items: stretch !important;
}
#tab-income-analysis .analysis-grid .card-block {
    height: 360px !important;
    min-height: 360px !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
}
#tab-income-analysis .analysis-grid.grid-3 .card-block {
    height: 320px !important;
    min-height: 320px !important;
    max-height: none !important;
}
#tab-income-analysis .analysis-grid .card-block > h3 {
    flex: 0 0 auto !important;
}
#tab-income-analysis .analysis-grid .card-block > div {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    padding-right: 0.25rem !important;
}
#tab-income-analysis #income-daily-trend {
    overflow-y: auto !important;
}
#tab-income-analysis .income-conclusion {
    max-height: none !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
}
#tab-income-analysis .income-conclusion > div {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
}
@media (max-width: 1280px) {
    #tab-income-analysis .analysis-grid .card-block {
        height: 320px !important;
        min-height: 320px !important;
        max-height: none !important;
    }
}

/* Profit analysis module */
.profit-shell { display:flex; flex-direction:column; gap:1rem; }
.profit-ledger-status { min-height:36px; display:inline-flex; align-items:center; padding:0 10px; border-radius:999px; font-size:.78rem; font-weight:700; border:1px solid rgba(255,255,255,.12); white-space:nowrap; }
.profit-ledger-status.is-live { color:#86efac; background:rgba(22,163,74,.12); border-color:rgba(74,222,128,.35); }
.profit-ledger-status.is-locked { color:#fcd34d; background:rgba(217,119,6,.12); border-color:rgba(251,191,36,.35); }
.profit-ledger-status.is-error { color:#fecaca; background:rgba(220,38,38,.14); border-color:rgba(248,113,113,.42); }
#tab-profit-analysis button:focus-visible, #tab-profit-analysis input:focus-visible { outline:3px solid rgba(96,165,250,.85); outline-offset:2px; }
#tab-profit-analysis button:disabled { opacity:.48; cursor:not-allowed; }
@media (prefers-reduced-motion: reduce) { .profit-shell-modern #profit-kpis .cockpit-kpi { transition:none; } .profit-shell-modern #profit-kpis .cockpit-kpi:hover { transform:none; } }
/* v3.2.0.146: keep each profit field label and its state badges on one compact line */
#tab-profit-analysis .profit-field-label { gap:.25rem !important; font-size:.72rem !important; line-height:1 !important; white-space:nowrap !important; }
#tab-profit-analysis .profit-source-badge,
#tab-profit-analysis .profit-state { font-size:.62rem !important; padding:.18rem .32rem !important; white-space:nowrap !important; flex:0 0 auto !important; }
#tab-profit-analysis .analysis-grid { grid-template-columns:minmax(0,1fr) !important; }
#tab-profit-analysis .profit-form-module-grid { column-gap:.65rem !important; grid-template-columns:repeat(4,minmax(0,1fr)) !important; }
@media (max-width: 1280px) {
    #tab-profit-analysis .profit-form-module-grid { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
}
@media (max-width: 680px) {
    #tab-profit-analysis .profit-form-module-grid { grid-template-columns:1fr !important; }
}
/* 自动读取/手工填写均采用“项目 + 状态 + 金额”的单行账本格式，禁止桌面端拆成上下两行。 */
#tab-profit-analysis .profit-form-module .profit-field {
    display:grid !important;
    grid-template-columns:minmax(0, max-content) minmax(96px, 1fr) !important;
    align-items:center !important;
    column-gap:.55rem !important;
    row-gap:0 !important;
}
/* 只读数字框的浏览器上下箭头会盖住金额尾数，隐藏；只读框数字右对齐更好读 */
#tab-profit-analysis .profit-form-module input[type=number] {
    -moz-appearance:textfield !important;
}
#tab-profit-analysis .profit-form-module input[type=number]::-webkit-inner-spin-button,
#tab-profit-analysis .profit-form-module input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance:none !important; margin:0 !important;
}
#tab-profit-analysis .profit-form-module input[readonly] {
    text-align:right !important; padding-right:8px !important;
}
/* 项目名过长时省略号截断，别把金额框挤没 */
#tab-profit-analysis .profit-form-module .profit-field-label > span:first-child {
    overflow:hidden !important; text-overflow:ellipsis !important; max-width:9.5rem !important; display:inline-block !important; vertical-align:bottom !important;
}
#tab-profit-analysis .profit-form-module .profit-field-label {
    grid-column:1 !important;
    grid-row:1 !important;
}
#tab-profit-analysis .profit-form-module .profit-field > div {
    grid-column:2 !important;
    grid-row:1 !important;
    min-width:0 !important;
}
#tab-profit-analysis .profit-form-module .profit-field > div input { width:100% !important; }
#tab-profit-analysis .profit-form-module .profit-field > div + div { grid-column:1 / -1 !important; grid-row:2 !important; }
@media (max-width: 680px) {
    #tab-profit-analysis .profit-form-module .profit-field { grid-template-columns:1fr !important; row-gap:.35rem !important; }
    #tab-profit-analysis .profit-form-module .profit-field-label,
    #tab-profit-analysis .profit-form-module .profit-field > div { grid-column:1 !important; grid-row:auto !important; }
}
.profit-shell-modern { gap:1.25rem; }
.profit-shell-modern .profit-ledger-card { padding:1.25rem; }
.profit-ledger-card-header { display:flex; justify-content:space-between; align-items:flex-start; gap:1rem; margin-bottom:1rem; }
.profit-ledger-card-header h3 { margin:0; display:flex; align-items:center; gap:.55rem; font-size:1.05rem; letter-spacing:.01em; }
.profit-ledger-card-subtitle { margin:.35rem 0 0; color:#94a3b8; font-size:.78rem; line-height:1.5; }
.profit-source-legend { display:flex; gap:.4rem; margin-top:.55rem; }
.profit-shell-modern .profit-form-module { border:1px solid rgba(148,163,184,.13); background:rgba(15,23,42,.34); border-radius:12px; padding:.85rem; }
.profit-shell-modern .profit-form-module h4 { margin-top:0; color:#dbeafe; }
.profit-shell-modern .profit-field > span { color:#cbd5e1; font-weight:600; }
.profit-shell-modern .profit-field-label { display:flex; align-items:center; justify-content:flex-start; gap:.5rem; flex-wrap:nowrap; white-space:nowrap; min-width:0; }
.profit-shell-modern .profit-field-label > span:first-child { white-space:nowrap; flex:0 0 auto; }
.profit-shell-modern .profit-source-badge { flex:0 0 auto; white-space:nowrap; }
.profit-source-badge { font-style:normal; font-size:.68rem; font-weight:700; white-space:nowrap; padding:.16rem .38rem; border-radius:999px; }
.profit-source-badge.is-auto { color:#bfdbfe; background:rgba(59,130,246,.14); }
.profit-source-badge.is-manual { color:#fde68a; background:rgba(245,158,11,.14); }
.profit-shell-modern .profit-field input { min-height:44px; font-variant-numeric:tabular-nums; }
@media (max-width:720px) { .profit-ledger-card-header { flex-direction:column; } .profit-ledger-card-header > div:last-child { width:100%; } }
.profit-shell-modern .profit-month-toolbar { position:sticky; top:0.5rem; z-index:20; background:rgba(15,23,42,.94); border:1px solid rgba(96,165,250,.22); box-shadow:0 12px 30px rgba(2,6,23,.28); backdrop-filter:blur(14px); }
.profit-shell-modern #profit-kpis { gap:1rem; }
.profit-shell-modern #profit-kpis .cockpit-kpi { border-color:rgba(96,165,250,.18); box-shadow:0 8px 22px rgba(2,6,23,.18); transition:transform .2s ease, border-color .2s ease; }
.profit-shell-modern #profit-kpis .cockpit-kpi:hover { transform:translateY(-2px); border-color:rgba(52,211,153,.42); }
.profit-shell-modern .card-block { border-color:rgba(96,165,250,.14); }
@media (max-width: 768px) { .profit-shell-modern .profit-month-toolbar { position:static; } .profit-shell-modern .profit-month-tools { width:100%; flex-wrap:wrap; } .profit-shell-modern .profit-month-tools > * { min-height:44px; } }
.profit-dynamic-workspace { display:grid; grid-template-columns:minmax(0,1fr); gap:.75rem; }
.profit-dynamic-hero { display:grid; grid-template-columns:minmax(210px,.9fr) minmax(280px,1.25fr) minmax(270px,1fr); gap:1rem; align-items:center; position:relative; overflow:hidden; padding:1.35rem 1.5rem; border:1px solid rgba(96,165,250,.3); border-radius:18px; background:linear-gradient(115deg,rgba(30,41,59,.96),rgba(15,23,42,.96)); box-shadow:0 16px 38px rgba(2,6,23,.28); }
.profit-dynamic-hero::after { content:""; position:absolute; right:-80px; top:-90px; width:260px; height:260px; border-radius:50%; background:radial-gradient(circle,rgba(59,130,246,.17),transparent 67%); pointer-events:none; }
.profit-dynamic-hero.is-positive::after { background:radial-gradient(circle,rgba(34,197,94,.19),transparent 67%); }
.profit-dynamic-eyebrow { grid-column:1/-1; display:flex; align-items:center; gap:.45rem; color:#93c5fd; font-size:.78rem; font-weight:800; letter-spacing:.05em; }
.profit-dynamic-result { display:grid; gap:.25rem; align-content:center; }
.profit-dynamic-result span, .profit-dynamic-result small, .profit-dynamic-facts span { color:#94a3b8; font-size:.78rem; }
.profit-dynamic-result strong { color:#fb7185; font-family:var(--font-mono); font-size:2rem; line-height:1.1; letter-spacing:-.04em; }
.profit-dynamic-hero.is-positive .profit-dynamic-result strong { color:#34d399; }
.profit-dynamic-facts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); border-left:1px solid rgba(148,163,184,.16); }
.profit-dynamic-facts div { display:grid; gap:.35rem; padding:.15rem 1rem; border-right:1px solid rgba(148,163,184,.16); }
.profit-dynamic-facts b { color:#f8fafc; font-family:var(--font-mono); font-size:1.03rem; font-variant-numeric:tabular-nums; }
.profit-dynamic-sync { justify-self:end; display:flex; align-items:center; gap:.45rem; padding:.55rem .7rem; border:1px solid rgba(74,222,128,.28); border-radius:10px; color:#bbf7d0; background:rgba(22,163,74,.09); font-size:.76rem; font-weight:700; white-space:nowrap; }
.profit-dynamic-sync time { color:#86efac; font-variant-numeric:tabular-nums; }
.profit-dynamic-guidance { display:flex; align-items:center; gap:.55rem; padding:.7rem .9rem; border:1px solid rgba(96,165,250,.18); border-radius:12px; color:#bfdbfe; background:rgba(30,58,138,.1); font-size:.82rem; }
.profit-shell-modern .profit-dynamic-panel { min-height:unset !important; border:1px solid rgba(96,165,250,.22) !important; border-radius:18px; background:linear-gradient(180deg,rgba(30,41,59,.42),rgba(15,23,42,.26)); box-shadow:0 10px 26px rgba(2,6,23,.16); }
.profit-shell-modern .profit-dynamic-panel h3 { display:flex; align-items:center; gap:.5rem; }
.profit-shell-modern .profit-dynamic-panel h3::before { content:""; width:4px; height:1.1em; border-radius:999px; background:#60a5fa; }
@media (max-width:1180px) { .profit-dynamic-hero { grid-template-columns:1fr 1fr; } .profit-dynamic-eyebrow { grid-column:1/-1; } .profit-dynamic-sync { justify-self:start; } }
@media (max-width:720px) { .profit-dynamic-hero { grid-template-columns:1fr; padding:1rem; } .profit-dynamic-facts { border-left:0; } .profit-dynamic-facts div { padding:.3rem .55rem; } .profit-dynamic-sync { white-space:normal; } .profit-dynamic-result strong { font-size:1.7rem; } }
.profit-month-tools { display:flex; align-items:center; gap:.6rem; }
.profit-evidence-check { display:inline-flex; align-items:baseline; gap:.4rem; width:max-content; max-width:100%; margin-top:.45rem; padding:.3rem .55rem; border:1px solid transparent; border-radius:8px; font-size:.735rem; font-style:normal; font-variant-numeric:tabular-nums; line-height:1.35; letter-spacing:.005em; text-decoration:none; transition:filter .12s ease; }
.profit-evidence-check .fa-camera { font-size:.7rem; opacity:.85; align-self:center; }
.profit-evidence-check b { font-weight:700; }
a.profit-evidence-check:hover { filter:brightness(1.12); }
.profit-evidence-check.is-match { color:#86efac; background:rgba(22,163,74,.13); border-color:rgba(74,222,128,.28); }
.profit-evidence-check.is-mismatch { color:#fca5a5; background:rgba(220,38,38,.12); border-color:rgba(248,113,113,.3); }
.profit-evidence-check.is-pending { color:#94a3b8; background:rgba(148,163,184,.1); border-color:rgba(148,163,184,.22); }
/* 证据徽章独占一行、贴左，短的自适应宽度不占满 */
.profit-form-grid .profit-field > .profit-evidence-check,
#tab-profit-analysis .profit-form-module .profit-field > .profit-evidence-check { grid-column:1 / -1 !important; justify-self:start !important; align-self:start !important; }
.profit-form-grid { display:grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap:.75rem; }
.profit-field { display:flex; flex-direction:column; gap:.35rem; font-size:.78rem; color:var(--text-secondary); }
.profit-field input { width:100%; border:1px solid rgba(255,255,255,.12); background:rgba(255,255,255,.045); color:var(--text-primary); border-radius:10px; padding:.55rem .65rem; font-size:.88rem; outline:none; }
.profit-field input:focus { border-color:rgba(96,165,250,.65); box-shadow:0 0 0 3px rgba(96,165,250,.12); }
#tab-profit-analysis .card-block { min-height:320px; }
.profit-section-total { float:right; color:#fbbf24; font-size:.95rem; font-weight:800; font-family:var(--font-mono); }
.profit-filter-bar { display:flex; gap:.45rem; margin:0 0 .8rem; flex-wrap:wrap; }
.profit-filter { border:1px solid rgba(148,163,184,.22); background:rgba(15,23,42,.55); color:#94a3b8; border-radius:999px; padding:.35rem .7rem; cursor:pointer; font-size:.76rem; }
.profit-filter.active { color:#dbeafe; border-color:#60a5fa; background:rgba(37,99,235,.2); }
.profit-state { font-style:normal; font-size:.68rem; padding:.12rem .35rem; border-radius:4px; color:#86efac; background:rgba(34,197,94,.12); }
.profit-state.is-pending { color:#fcd34d; background:rgba(245,158,11,.12); }
.profit-state.is-error { color:#fecaca; background:rgba(220,38,38,.18); }
.profit-field.is-error { border-left:3px solid #f87171; padding-left:.55rem; }
.profit-collapsible > summary { cursor:pointer; list-style:none; padding:1rem 1.2rem; border:1px solid rgba(96,165,250,.2); border-radius:12px; color:#dbeafe; font-weight:700; background:rgba(15,23,42,.6); }
.profit-collapsible > summary::-webkit-details-marker { display:none; }
.profit-collapsible > summary span { float:right; color:#94a3b8; font-size:.75rem; font-weight:400; }
.profit-collapsible[open] > summary { border-radius:12px 12px 0 0; }
@media (max-width:720px) { .profit-form-grid { grid-template-columns:1fr; } .profit-field { padding:.65rem 0; border-bottom:1px solid rgba(148,163,184,.12); } .profit-field-label { flex-wrap:wrap; } .profit-month-tools { gap:.35rem; } .profit-month-tools > button { flex:1 1 42%; } }
#tab-profit-analysis .analysis-row em { color:var(--text-secondary); font-style:normal; font-size:.75rem; margin-left:.35rem; }
@media (max-width: 1280px) { .profit-form-grid { grid-template-columns:1fr; } }

/* =====================================================
   手机端适配 (<=768px)
   ===================================================== */
@media (max-width: 768px) {
    /* 驾驶舱6模块单列 */
    .cockpit-row {
        grid-template-columns: 1fr !important;
    }

    /* 1. 容器整屏视口锁定 */
    body {
        overflow: hidden !important;
    }

    .app-container {
        display: flex !important;
        flex-direction: column !important;
        height: 100vh !important;
        height: 100dvh !important;
        width: 100vw !important;
        overflow: hidden !important;
        position: relative !important;
    }

    /* 2. 主区域：包含固定顶栏与滚动面板 */
    .main-content {
        order: 1 !important;
        flex: 1 1 auto !important;
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
        overflow: hidden !important;
        padding: 0 !important;
        margin: 0 !important;
        min-height: 0 !important;
        box-sizing: border-box !important;
    }

    /* 3. 顶部固定顶栏区 (Fixed Top Shell: 包含标题、日期和二级卡片，永不随滚动条滑走) */
    .top-app-header {
        flex: 0 0 auto !important;
        width: 100% !important;
        background: #0b0f19 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5) !important;
        padding: 8px 10px 8px 10px !important;
        box-sizing: border-box !important;
        z-index: 1000 !important;
    }

    .main-header {
        position: static !important;
        width: 100% !important;
        min-height: 38px !important;
        height: auto !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        box-sizing: border-box !important;
    }

    .header-title {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
    }

    .header-title h1,
    #page-title {
        font-size: 1.15rem !important;
        font-weight: 700 !important;
        color: #ffffff !important;
        white-space: nowrap !important;
        margin: 0 !important;
        line-height: 1.2 !important;
    }

    .mobile-version-tag {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 0.65rem !important;
        font-weight: 700 !important;
        color: #fbbf24 !important;
        background: rgba(251, 191, 36, 0.15) !important;
        border: 1px solid rgba(251, 191, 36, 0.3) !important;
        padding: 1px 5px !important;
        border-radius: 4px !important;
        line-height: 1 !important;
        flex-shrink: 0 !important;
    }

    /* 移动端顶栏右侧日期控件 */
    .date-selector-container {
        flex: 0 0 auto !important;
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
        margin: 0 !important;
        width: auto !important;
        flex-wrap: nowrap !important;
    }

    #btn-header-upload,
    #btn-header-audit {
        display: none !important;
    }

    .global-date-controls {
        display: inline-flex !important;
        align-items: center !important;
        gap: 2px !important;
        background: rgba(255, 255, 255, 0.08) !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        border-radius: 8px !important;
        padding: 1px 4px !important;
        height: 32px !important;
        box-sizing: border-box !important;
    }

    .global-date-controls #btn-global-prev,
    .global-date-controls #btn-global-next {
        padding: 0 4px !important;
        font-size: 0.75rem !important;
        height: 28px !important;
        line-height: 28px !important;
        color: #94a3b8 !important;
    }

    #global-date-picker {
        font-size: 0.78rem !important;
        padding: 0 2px !important;
        min-width: 106px !important;
        max-width: 112px !important;
        height: 28px !important;
        font-weight: 700 !important;
    }

    /* 4. 二级子卡片收纳栏 (紧随 header 下方，整行平铺，大字清晰) */
    .sub-nav-bar {
        position: static !important;
        width: 100% !important;
        height: 38px !important;
        min-height: 38px !important;
        margin: 6px 0 0 0 !important;
        padding: 3px !important;
        border-radius: 8px !important;
        background: rgba(255, 255, 255, 0.06) !important;
        border: 1px solid rgba(255, 255, 255, 0.12) !important;
        gap: 4px !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
    }

    .sub-nav-pill {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        height: 32px !important;
        min-height: 32px !important;
        padding: 0 4px !important;
        font-size: 13.5px !important;
        font-weight: 700 !important;
        border-radius: 6px !important;
        text-align: center !important;
        line-height: 32px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .sub-nav-pill span {
        display: inline-block !important;
        white-space: nowrap !important;
        font-size: 13.5px !important;
        font-weight: 700 !important;
        color: inherit !important;
    }

    /* 5. 所有 Tab 内容面板：独立垂直滚动区域 */
    .tab-panel {
        flex: 1 1 auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 10px 10px calc(64px + env(safe-area-inset-bottom, 0px)) 10px !important;
        box-sizing: border-box !important;
        min-height: 0 !important;
        height: auto !important;
    }

    /* 6. 移动端底部 5 大导航栏彻底固定锁死 (Fixed Bottom Navigation) */
    .logo-container,
    .sidebar-footer {
        display: none !important;
    }

    .sidebar {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: calc(52px + env(safe-area-inset-bottom, 0px)) !important;
        padding-bottom: env(safe-area-inset-bottom, 0px) !important;
        border-right: none !important;
        border-top: 1px solid rgba(255, 255, 255, 0.14) !important;
        background: rgba(15, 23, 42, 0.98) !important;
        backdrop-filter: blur(24px) !important;
        -webkit-backdrop-filter: blur(24px) !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5) !important;
        z-index: 9999 !important;
        order: 2 !important;
        margin: 0 !important;
        overflow: hidden !important;
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: center !important;
        box-sizing: border-box !important;
    }

    .nav-menu {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 2px !important;
        width: 100% !important;
        height: 52px !important;
        padding: 0 4px !important;
        justify-content: space-around !important;
        align-items: center !important;
        box-sizing: border-box !important;
    }

    .nav-item {
        flex: 1 1 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 2px !important;
        height: 46px !important;
        padding: 2px !important;
        font-size: 0.65rem !important;
        white-space: nowrap !important;
        text-align: center !important;
        border-radius: 8px !important;
        color: #94a3b8 !important;
        box-sizing: border-box !important;
    }

    .nav-item i {
        font-size: 1.05rem !important;
        line-height: 1 !important;
    }

    .nav-item.active {
        background: rgba(255, 186, 8, 0.18) !important;
        color: #ffba08 !important;
        font-weight: 700 !important;
    }

    /* 经营驾驶舱 KPI 卡片 2列 */
    #management-dashboard-cards {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* 堂食/团购/外卖 卡片 2列 */
    #tab-overview .comparison-summary-cards {
        grid-template-columns: 1fr !important;
    }

    /* 收入分析页面 */
    #tab-income-analysis .income-kpi-grid,
    #tab-income-analysis .kpi-grid-6 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    #tab-income-analysis .analysis-grid,
    #tab-income-analysis .analysis-grid.grid-3 {
        grid-template-columns: 1fr !important;
    }
    #tab-income-analysis .analysis-grid .card-block,
    #tab-purchase-analysis .analysis-grid .card-block {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
    }

    /* 对账中心 */
    .reconcile-grid {
        grid-template-columns: 1fr !important;
    }
    .comparison-summary-cards {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    #tab-reconciliation-center .reconcile-three-column-grid {
        grid-template-columns: 1fr !important;
    }
    #tab-reconciliation-center .reconcile-column {
        grid-template-rows: auto auto auto !important;
    }

    /* 表格横向滚动 */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 弹窗 */
    .edit-sheet {
        width: 95% !important;
        max-width: none !important;
    }

    /* 柱状图/图表 */
    .chart-div,
    .large-chart-div {
        height: 260px;
    }
}

/* Wage / analysis month chips */
.cockpit-wage-card { cursor: pointer; }
.wage-month-chip-row,
.analysis-month-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-top: .8rem;
    width: 100%;
}
.wage-month-chip,
.analysis-month-chip {
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.045);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: .28rem .7rem;
    font-size: .7rem;
    font-weight: 800;
    cursor: pointer;
}
.wage-month-chip.active,
.analysis-month-chip.active {
    color: #111827;
    background: #fbbf24;
    border-color: #fbbf24;
}
.wage-month-chip:hover,
.analysis-month-chip:hover { border-color: rgba(251,191,36,.7); color: #fff; }
.wage-month-chip.active:hover,
.analysis-month-chip.active:hover { color:#111827; }
.purchase-month-toolbar { margin-bottom: .15rem; }


/* Analysis empty helper: show data source message inside cards */
#tab-income-analysis .card-block > div:has(> .empty-placeholder),
#tab-purchase-analysis .card-block > div:has(> .empty-placeholder) {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
#tab-income-analysis .card-block > div:has(> .empty-placeholder)::after,
#tab-purchase-analysis .card-block > div:has(> .empty-placeholder)::after {
    content: '如已上传历史文件，请确认为收入/采购订单明细，而非采购入库单。';
    font-size: 0.72rem;
    color: rgba(255,255,255,0.45);
}

/* Reconciliation v1.3.12: remove redundant filter text */

/* Purchase analysis v1.3.31: force visible safe render */
#tab-purchase-analysis .purchase-shell { display: flex; flex-direction: column; gap: 1rem; }
#tab-purchase-analysis .income-kpi-grid { grid-template-columns: repeat(3,minmax(0,1fr)) !important; }
#tab-purchase-analysis .income-conclusion { border-left: 3px solid #fbbf24 !important; }
#tab-purchase-analysis .income-conclusion h3 { color: #fbbf24 !important; }
#tab-purchase-analysis .income-conclusion .item { padding: 8px 0; border-bottom: 1px dashed rgba(255,255,255,.12); }
#tab-purchase-analysis .income-conclusion .item:last-child { border-bottom: 0; padding-bottom: 0; }
#tab-purchase-analysis .income-conclusion .item:first-child { padding-top: 0; }
#tab-purchase-analysis .income-conclusion .q { font-weight: 700; margin-bottom: 4px; font-size: .74rem; color: #f8fafc; }
#tab-purchase-analysis .income-conclusion .a { font-size: .72rem; color: rgba(255,255,255,.72); }
#tab-purchase-analysis .analysis-grid .card-block { min-height: 340px; height: auto !important; max-height: none !important; overflow: visible !important; }
#tab-purchase-analysis .analysis-grid .card-block > div { overflow: visible !important; max-height: none !important; }
#tab-purchase-analysis #purchase-month-trend { min-height: 280px !important; height: 340px !important; width: 100% !important; }
#tab-purchase-analysis .analysis-month-toolbar { margin-bottom: .6rem; }
#tab-purchase-analysis .income-kpi-grid { grid-template-columns: repeat(3,minmax(0,1fr)) !important; }
#tab-purchase-analysis .income-conclusion { border-left: 3px solid #fbbf24 !important; }
#tab-purchase-analysis .income-conclusion h3 { color: #fbbf24 !important; }
#tab-purchase-analysis .income-conclusion .item { padding: 8px 0; border-bottom: 1px dashed rgba(255,255,255,.12); }
#tab-purchase-analysis .income-conclusion .item:last-child { border-bottom: 0; padding-bottom: 0; }
#tab-purchase-analysis .income-conclusion .item:first-child { padding-top: 0; }
#tab-purchase-analysis .income-conclusion .q { font-weight: 700; margin-bottom: 4px; font-size: .74rem; color: #f8fafc; }
#tab-purchase-analysis .income-conclusion .a { font-size: .72rem; color: rgba(255,255,255,.72); }
#tab-purchase-analysis .analysis-grid .card-block { min-height: 340px; height: auto !important; max-height: none !important; overflow: visible !important; }
#tab-purchase-analysis .analysis-grid .card-block > div { overflow: visible !important; max-height: none !important; }
#tab-purchase-analysis #purchase-conclusions { overflow: visible !important; max-height: none !important; }
#tab-purchase-analysis #purchase-summary-banner,
#tab-purchase-analysis #purchase-kpis,
#tab-purchase-analysis #purchase-debug-box { display: block !important; visibility: visible !important; opacity: 1 !important; }

/* Purchase analysis v1.3.33: safe final structure */

/* Purchase analysis v1.3.36: debug overlay temporarily disabled */


/* Reconciliation v1.3.54: compact periodic settlement area; details first */
#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-section:first-child .recon-section-body {
    display: grid !important;
    grid-template-rows: auto auto 1fr !important;
    gap: 0.75rem !important;
    padding: 0.9rem 1.1rem !important;
    overflow: visible !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(3) #periodic-category-chips {
    flex: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    gap: 0.45rem !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(3) #periodic-category-chips .recon-chip {
    height: 34px !important;
    padding: 0 0.78rem !important;
    border-radius: 999px !important;
    font-size: 0.82rem !important;
}
#tab-reconciliation-center #periodic-supplier-chips:empty {
    display: none !important;
    min-height: 0 !important;
    max-height: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-stats-2 {
    flex: none !important;
    margin: 0 !important;
    padding: 0.5rem 0 !important;
    min-height: 0 !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-stat-item {
    padding: 0 !important;
    min-height: 0 !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-stat-item span {
    font-size: 0.72rem !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-stat-item b {
    font-size: 1rem !important;
}
#tab-reconciliation-center #periodic-outstanding-list {
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    padding-right: 0.35rem !important;
}
#tab-reconciliation-center #periodic-outstanding-list .detail-item-row {
    padding: 0.6rem 0 !important;
}

/* Income analysis v1.3.68: clean modern layout */
#tab-income-analysis .income-shell { gap: 1.2rem !important; }
#tab-income-analysis .income-tab-header {
    padding: 1.2rem 1.4rem !important;
    border-radius: 18px !important;
    background: rgba(255,255,255,.03) !important;
    border: 1px solid rgba(255,255,255,.08) !important;
}
#tab-income-analysis .tab-title { font-size: 1rem !important; }
#tab-income-analysis .tab-meta { font-size: .72rem !important; opacity: .6; }
#tab-income-analysis .income-kpi-grid { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important; gap: 0.85rem !important; }

@media (min-width: 1440px) {
    #tab-income-analysis .income-kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
}

@media (max-width: 768px) {
    #tab-income-analysis .income-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 0.6rem !important; }
}

#tab-income-analysis .card-block {
    background: rgba(255,255,255,.025) !important;
    border: 1px solid rgba(255,255,255,.065) !important;
    border-radius: 16px !important;
    padding: 1.1rem 1.3rem !important;
}
#tab-income-analysis .card-block h3 {
    font-size: .82rem !important;
    font-weight: 700 !important;
    margin-bottom: .7rem !important;
    color: rgba(255,255,255,.75) !important;
}
#tab-income-analysis .card-block h3 .tag {
    font-size: .65rem !important;
    opacity: .55;
    font-weight: 500;
}
#tab-income-analysis .analysis-row {
    padding: .5rem 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.05) !important;
    font-size: .74rem !important;
}
#tab-income-analysis .analysis-row b { font-size: .82rem !important; }
#tab-income-analysis .analysis-group-title {
    font-size: .76rem !important;
    font-weight: 800 !important;
    color: #fbbf24 !important;
    margin: .7rem 0 .35rem !important;
}
#tab-income-analysis .analysis-grid { gap: 1rem !important; }
#tab-income-analysis .income-conclusion {
    border-left: 3px solid #38bdf8 !important;
    padding: .9rem 1.2rem !important;
}
#tab-income-analysis .income-conclusion .item { padding: .5rem 0 !important; }
#tab-income-analysis .income-conclusion .q { font-size: .78rem !important; font-weight: 800 !important; }
#tab-income-analysis .income-conclusion .a { font-size: .72rem !important; opacity: .75; }

/* Purchase analysis v1.3.68: compact clean layout */
#tab-purchase-analysis .purchase-shell { display: flex; flex-direction: column; gap: 1.2rem; }
#tab-purchase-analysis .section-hero {
    padding: 1.2rem 1.4rem !important;
    border-radius: 18px !important;
    background: rgba(255,255,255,.03) !important;
    border: 1px solid rgba(255,255,255,.08) !important;
}
#tab-purchase-analysis .tab-title { font-size: 1rem !important; }
#tab-purchase-analysis .tab-meta { font-size: .72rem !important; opacity: .6; }
#tab-purchase-analysis .income-kpi-grid { grid-template-columns: repeat(3,minmax(0,1fr)) !important; gap: 1rem !important; margin-bottom: 0 !important; }
#tab-purchase-analysis .card-block {
    background: rgba(255,255,255,.025) !important;
    border: 1px solid rgba(255,255,255,.065) !important;
    border-radius: 16px !important;
    padding: 1rem 1.2rem !important;
    min-height: auto !important;
    height: auto !important;
    max-height: 340px !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}
#tab-purchase-analysis #purchase-group-summary > div, #tab-purchase-analysis #purchase-group-summary > div[style] {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    align-items: center !important;
}
#tab-purchase-analysis #purchase-group-summary > div > div[style] {
    display: inline-flex !important;
    align-items: center !important;
    gap: .08rem !important;
    flex: 1 1 140px !important;
    min-width: 140px !important;
    flex-wrap: wrap !important;
}
#tab-purchase-analysis #purchase-sellable-summary > div,
#tab-purchase-analysis #purchase-drink-summary > div,
#tab-purchase-analysis #analysis-top-suppliers > div,
#tab-purchase-analysis #purchase-item-summary > div {
    display: flex !important;
    flex-wrap: wrap !important;
    overflow-y: auto !important;
}
#tab-purchase-analysis #purchase-sellable-summary > div > div[style],
#tab-purchase-analysis #purchase-drink-summary > div > div[style],
#tab-purchase-analysis #analysis-top-suppliers > div > div[style],
#tab-purchase-analysis #purchase-item-summary > div > div[style] {
    display: inline-flex !important;
    align-items: center !important;
    gap: .08rem !important;
    flex: 1 1 50% !important;
    min-width: 180px !important;
    flex-wrap: wrap !important;
}
#tab-purchase-analysis .card-block h2, #tab-purchase-analysis .card-block h3 {
    font-size: .82rem !important;
    font-weight: 700 !important;
    margin-bottom: .6rem !important;
    color: rgba(255,255,255,.75) !important;
    flex-shrink: 0 !important;
}
#tab-purchase-analysis .card-block h2 small, #tab-purchase-analysis .card-block h3 .tag {
    font-size: .65rem !important;
    opacity: .55;
    font-weight: 500;
}
#tab-purchase-analysis .card-block > div {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    padding-right: 0.25rem !important;
}
#tab-purchase-analysis .kpi-grid-6 { gap: 1rem !important; margin-bottom: 0; }
#tab-purchase-analysis .kpi-grid-6 .comp-card { padding: .8rem !important; border-radius: 10px !important; background: rgba(255,255,255,.035) !important; border: 1px solid rgba(255,255,255,.06) !important; }
#tab-purchase-analysis .kpi-grid-6 .comp-card > div:first-child { font-size: .7rem !important; opacity: .65; }
#tab-purchase-analysis .kpi-grid-6 .comp-card > div:nth-child(2) { font-size: .92rem !important; font-weight: 800 !important; color: #fbbf24 !important; }
#tab-purchase-analysis .kpi-grid-6 .comp-card > div:nth-child(3) { font-size: .62rem !important; opacity: .5; }
#tab-purchase-analysis .analysis-grid { gap: 1rem !important; }
#tab-purchase-analysis .analysis-row { padding: .45rem 0 !important; font-size: .72rem !important; }
#tab-purchase-analysis .analysis-row b { font-size: .78rem !important; }
#tab-purchase-analysis .analysis-month-toolbar { margin-bottom: .5rem; }
#tab-purchase-analysis .analysis-month-chip { font-size: .72rem !important; padding: .22rem .6rem !important; }
#tab-purchase-analysis #purchase-month-trend { height: 100% !important; min-height: 220px !important; }
#tab-purchase-analysis .income-conclusion {
    border-left: 3px solid #fbbf24 !important;
    padding: .9rem 1.2rem !important;
    max-height: 280px !important;
    overflow-y: auto !important;
}
#tab-purchase-analysis .income-conclusion .item { padding: .45rem 0 !important; }
#tab-purchase-analysis .income-conclusion .q { font-size: .76rem !important; font-weight: 800 !important; }
#tab-purchase-analysis .income-conclusion .a { font-size: .7rem !important; opacity: .75; }
#tab-purchase-analysis #purchase-cross-summary > div.kpi-grid-6 .comp-card { padding: .75rem !important; }
#tab-purchase-analysis #purchase-cross-summary > div.kpi-grid-6 .comp-card > div:first-child { font-size: .68rem !important; }
#tab-purchase-analysis #purchase-cross-summary > div.kpi-grid-6 .comp-card > div:nth-child(2) { font-size: .9rem !important; }
#tab-purchase-analysis #purchase-cross-summary > div.kpi-grid-6 .comp-card > div:nth-child(3) { font-size: .6rem !important; }
#tab-purchase-analysis #purchase-month-table table { font-size: .78rem !important; }
#tab-purchase-analysis #purchase-month-table th { font-size: .7rem !important; padding: .5rem .5rem !important; }
#tab-purchase-analysis #purchase-month-table td { padding: .45rem .5rem !important; font-size: .74rem !important; }
#tab-purchase-analysis #purchase-month-table { max-height: 300px !important; overflow-y: auto !important; }

@media (max-width: 768px) {
    #tab-purchase-analysis .income-kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
    #tab-purchase-analysis .analysis-grid { grid-template-columns: 1fr !important; }
}

/* Purchase analysis v1.3.72: inline chips only for purchase lists; keep charts elsewhere */
#tab-purchase-analysis .inline-metric-list {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: .45rem .5rem !important;
    align-content: flex-start !important;
    overflow-y: auto !important;
}
#tab-purchase-analysis .inline-metric-chip {
    display: inline-flex !important;
    align-items: center !important;
    gap: .35rem !important;
    min-width: 150px !important;
    max-width: 240px !important;
    padding: .35rem .55rem !important;
    border-radius: 999px !important;
    background: rgba(255,255,255,.045) !important;
    border: 1px solid rgba(255,255,255,.07) !important;
    font-size: .7rem !important;
    line-height: 1 !important;
}
#tab-purchase-analysis .inline-metric-chip em {
    flex: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    color: rgba(255,255,255,.72) !important;
    font-style: normal !important;
}
#tab-purchase-analysis .inline-metric-chip b {
    flex: none !important;
    font-size: .72rem !important;
    color: #fbbf24 !important;
}

/* Purchase analysis v1.3.73: remove useless hero and force KPI into one compact row */
#tab-purchase-analysis .section-hero.income-tab-header {
    display: none !important;
}
#tab-purchase-analysis #purchase-kpis {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(135px, 1fr)) !important;
    gap: .55rem !important;
    margin: 0 0 .65rem 0 !important;
    overflow-x: auto !important;
    padding-bottom: .15rem !important;
    visibility: visible !important;
    opacity: 1 !important;
}
#tab-purchase-analysis #purchase-kpis .comp-card {
    min-height: 0 !important;
    height: 58px !important;
    padding: .45rem .6rem !important;
    border-radius: 10px !important;
    background: rgba(255,255,255,.035) !important;
    border: 1px solid rgba(255,255,255,.06) !important;
    box-shadow: none !important;
    overflow: hidden !important;
}
#tab-purchase-analysis #purchase-kpis .comp-card > div:first-child {
    font-size: .64rem !important;
    line-height: 1 !important;
    opacity: .62 !important;
}
#tab-purchase-analysis #purchase-kpis .comp-card > div:nth-child(2) {
    margin-top: .18rem !important;
    font-size: .82rem !important;
    line-height: 1.1 !important;
    color: #fbbf24 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
#tab-purchase-analysis #purchase-kpis .comp-card > div:nth-child(3) {
    margin-top: .14rem !important;
    font-size: .58rem !important;
    line-height: 1 !important;
    opacity: .38 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
#tab-purchase-analysis .purchase-month-toolbar {
    margin-bottom: .55rem !important;
}

/* Purchase analysis v1.3.74: restore real analysis bars, keep only KPI compact */
#tab-purchase-analysis #purchase-group-summary > div,
#tab-purchase-analysis #purchase-sellable-summary > div,
#tab-purchase-analysis #purchase-drink-summary > div,
#tab-purchase-analysis #analysis-top-suppliers > div,
#tab-purchase-analysis #purchase-item-summary > div {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
}
#tab-purchase-analysis #purchase-group-summary > div > div[style],
#tab-purchase-analysis #purchase-sellable-summary > div > div[style],
#tab-purchase-analysis #purchase-drink-summary > div > div[style],
#tab-purchase-analysis #analysis-top-suppliers > div > div[style],
#tab-purchase-analysis #purchase-item-summary > div > div[style] {
    display: block !important;
    flex: 1 1 auto !important;
    min-width: 80px !important;
}
#tab-purchase-analysis #purchase-month-trend {
    width: 100% !important;
    height: 260px !important;
    min-height: 260px !important;
}

/* Analysis v1.3.75: trend charts must use full card width */
#tab-income-analysis #income-month-trend,
#tab-purchase-analysis #purchase-month-trend {
    display: block !important;
    width: 100% !important;
    height: 300px !important;
    min-height: 300px !important;
    overflow: hidden !important;
}

/* Purchase analysis v1.3.76: KPI cards match cost-board size; overflow scrolls vertically */
#tab-purchase-analysis #purchase-kpis {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
    gap: 14px !important;
    margin: 0 0 16px 0 !important;
    padding: 0 !important;
    overflow: visible !important;
}
#tab-purchase-analysis #purchase-kpis .comp-card {
    height: 108px !important;
    min-height: 108px !important;
    padding: 18px !important;
    border-radius: 18px !important;
    background: rgba(255,255,255,.035) !important;
    border: 1px solid rgba(255,255,255,.08) !important;
    box-shadow: none !important;
}
#tab-purchase-analysis #purchase-kpis .comp-card > div:first-child {
    font-size: 12px !important;
    line-height: 1.15 !important;
    opacity: .68 !important;
}
#tab-purchase-analysis #purchase-kpis .comp-card > div:nth-child(2) {
    margin-top: 8px !important;
    font-size: 24px !important;
    line-height: 1.05 !important;
    font-weight: 800 !important;
    color: #fbbf24 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
#tab-purchase-analysis #purchase-kpis .comp-card > div:nth-child(3) {
    margin-top: 6px !important;
    font-size: 12px !important;
    line-height: 1.1 !important;
    opacity: .45 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
#tab-purchase-analysis .analysis-grid .card-block {
    max-height: 360px !important;
    overflow: hidden !important;
}
#tab-purchase-analysis .analysis-grid .card-block > div {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-height: none !important;
}
#tab-purchase-analysis #purchase-month-trend {
    width: 100% !important;
    height: 300px !important;
    min-height: 300px !important;
    overflow: hidden !important;
}

/* v1.4.1: unify all month selectors with purchase-analysis chips */
#tab-profit-analysis .profit-month-toolbar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: .75rem !important;
    margin-bottom: .75rem !important;
}
#tab-profit-analysis #profit-month,
#tab-profit-analysis #btn-load-profit {
    display: none !important;
}
#tab-profit-analysis .profit-month-tools {
    flex: 0 0 auto !important;
}
#tab-profit-analysis #btn-save-profit {
    min-width: 112px !important;
    min-height: 44px !important;
    padding: .75rem 1.25rem !important;
    border-radius: 14px !important;
    font-size: 1rem !important;
    font-weight: 800 !important;
}
#tab-profit-analysis #profit-month-chips {
    flex: 1 1 auto !important;
}
#wage-month-chips .analysis-month-chip {
    font-size: .78rem;
    padding: .32rem .78rem;
}

/* v1.4.2: grouped profit income/expense forms */
#tab-profit-analysis .profit-form-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: .75rem !important;
}
#tab-profit-analysis .profit-form-module {
    border: 1px solid rgba(255,255,255,.07) !important;
    background: rgba(255,255,255,.025) !important;
    border-radius: 14px !important;
    padding: .75rem !important;
}
#tab-profit-analysis .profit-form-module h4 {
    margin: 0 0 .55rem !important;
    font-size: .76rem !important;
    line-height: 1 !important;
    color: rgba(255,255,255,.78) !important;
}
#tab-profit-analysis .profit-form-module-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: .55rem !important;
}
#tab-profit-analysis .profit-form-module .profit-field {
    gap: .28rem !important;
    font-size: .68rem !important;
}
#tab-profit-analysis .profit-form-module .profit-field input {
    min-height: 34px !important;
    padding: .42rem .5rem !important;
    border-radius: 9px !important;
    font-size: .82rem !important;
}
@media (max-width: 1280px) {
    #tab-profit-analysis .profit-form-grid,
    #tab-profit-analysis .profit-form-module-grid { grid-template-columns: 1fr !important; }
}

/* v1.4.3: profit grouped forms use the same flat style as other analysis modules */
#tab-profit-analysis .profit-form-module {
    border: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
}
#tab-profit-analysis .profit-form-module h4 {
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 0 .5rem !important;
    padding: .18rem .5rem !important;
    border-radius: 8px !important;
    background: rgba(148,163,184,.14) !important;
    color: rgba(255,255,255,.62) !important;
    font-size: .68rem !important;
    font-weight: 700 !important;
}
#tab-profit-analysis .profit-form-module-grid {
    gap: .6rem !important;
}

/* v1.4.4: restore visible boxed profit submodules */
#tab-profit-analysis .profit-form-module {
    border: 1px solid rgba(255,255,255,.07) !important;
    background: rgba(255,255,255,.025) !important;
    border-radius: 14px !important;
    padding: .75rem !important;
}
#tab-profit-analysis .profit-form-module h4 {
    display: block !important;
    margin: 0 0 .55rem !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    font-size: .76rem !important;
    line-height: 1 !important;
    color: rgba(255,255,255,.78) !important;
    font-weight: 700 !important;
}
#tab-profit-analysis .profit-form-module-grid {
    gap: .55rem !important;
}

/* v1.4.10: prepaid reimbursement reconciliation module */
.prepaid-recon-module {
    margin-top: 1.2rem;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.025);
}
.prepaid-head { display:flex; align-items:center; justify-content:space-between; gap:.75rem; margin-bottom:.8rem; }
.prepaid-head h3 { margin:0; font-size:.92rem; display:flex; align-items:center; gap:.45rem; }
.prepaid-grid { display:grid; grid-template-columns: 1fr 1fr; gap:1rem; }
.prepaid-card { border:1px solid rgba(255,255,255,.07); background:rgba(255,255,255,.025); border-radius:14px; padding:.85rem; min-height:220px; }
.prepaid-card h4 { margin:0 0 .65rem; font-size:.8rem; color:rgba(255,255,255,.78); }
.prepaid-card h4 small { font-size:.66rem; color:rgba(255,255,255,.42); margin-left:.35rem; }
.prepaid-form-row { display:grid; grid-template-columns: 130px 1fr 1fr 74px; gap:.5rem; align-items:center; }
.prepaid-form-row .filter-input { height:34px; font-size:.72rem; padding:.35rem .55rem; }
.prepaid-form-row .btn { height:34px; padding:.25rem .7rem; font-size:.72rem; }
.prepaid-hint { margin:.45rem 0 .6rem; font-size:.66rem; color:rgba(255,255,255,.42); }
.prepaid-table { max-height:260px; overflow-y:auto; }
.prepaid-mini-table { width:100%; border-collapse:collapse; font-size:.72rem; }
.prepaid-mini-table th { text-align:left; color:rgba(255,255,255,.45); font-weight:700; padding:.45rem .4rem; border-bottom:1px solid rgba(255,255,255,.08); }
.prepaid-mini-table td { padding:.48rem .4rem; border-bottom:1px solid rgba(255,255,255,.055); font-variant-numeric:tabular-nums; }
.prepaid-mini-table th:not(:first-child), .prepaid-mini-table td:not(:first-child) { text-align:right; }
.prepaid-negative td:last-child { color:#fb7185; font-weight:800; }
@media (max-width: 1280px) { .prepaid-grid { grid-template-columns:1fr; } .prepaid-form-row { grid-template-columns:1fr 1fr; } }

/* v1.4.11: compact prepaid module with KPI row and password prompt */
.prepaid-recon-module { min-height: 0 !important; }
.prepaid-kpi-row { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.75rem; margin-bottom:.85rem; }
.prepaid-kpi { border:1px solid rgba(255,255,255,.07); background:rgba(255,255,255,.03); border-radius:12px; padding:.75rem .9rem; }
.prepaid-kpi span { display:block; font-size:.68rem; color:rgba(255,255,255,.5); margin-bottom:.35rem; }
.prepaid-kpi b { display:block; font-size:.92rem; color:#fbbf24; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.prepaid-card { min-height: 180px !important; }
.prepaid-form-row { grid-template-columns: 130px 1fr 74px !important; }
.prepaid-hint { display:none !important; }
@media (max-width:1280px){ .prepaid-kpi-row{grid-template-columns:1fr;} .prepaid-form-row{grid-template-columns:1fr 1fr !important;} }

/* v1.4.12: move prepaid KPIs into reconciliation page top row */
.recon-kpi-card.green b { color:#34d399; }
.recon-kpi-card.cyan b { color:#22d3ee; }
.recon-kpi-card.violet b { color:#a78bfa; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prepaid-kpi-row { display:none !important; }
.prepaid-recon-module { padding: .9rem 1rem !important; }
.prepaid-grid { gap: .75rem !important; }
.prepaid-card { min-height: 0 !important; padding: .75rem !important; }
.prepaid-table .empty-placeholder { padding: 1rem !important; min-height: 0 !important; }
/* v1.4.13: reduce reconciliation blank space; check KPI wording */
#tab-reconciliation-center .reconcile-three-column-grid { align-items: start !important; }
#tab-reconciliation-center .reconcile-column > * { flex: none !important; }
#tab-reconciliation-center .prepaid-recon-module { margin-top: .8rem !important; }
#tab-reconciliation-center .recon-kpi-card.violet b { font-size: .86rem !important; }

/* v1.4.14: remove forced blank rows in reconciliation columns */
#tab-reconciliation-center .reconcile-column {
    display: flex !important;
    flex-direction: column !important;
    grid-template-rows: none !important;
    gap: .75rem !important;
    align-items: stretch !important;
}
#tab-reconciliation-center .reconcile-column > .recon-section {
    height: auto !important;
    min-height: 0 !important;
    flex: none !important;
}
#tab-reconciliation-center .recon-section-body {
    min-height: 0 !important;
}
#tab-reconciliation-center .recon-scroll-list {
    min-height: 0 !important;
}
#tab-reconciliation-center .prepaid-recon-module {
    margin-top: .75rem !important;
}
@media (max-width: 1500px) { .recon-command-center-new { grid-template-columns: repeat(4, minmax(118px, 1fr)) !important; gap: .65rem !important; } }

/* v1.5.10: 7-card KPI 2-row layout */
.recon-command-center-new {
    grid-template-columns: repeat(4, minmax(118px, 1fr)) !important;
    gap: .85rem !important;
    padding: 1rem !important;
}
.recon-command-center-new .recon-kpi-card { min-height: 76px; padding: .8rem 1rem; }
.recon-command-center-new .recon-kpi-card span { font-size: .78rem; }
.recon-command-center-new .recon-kpi-card b { font-size: 1.25rem; margin-top: .25rem; }
.recon-command-center-new .recon-kpi-card em { font-size: .72rem; margin-top: .2rem; }
#btn-header-audit {
    height: 38px;
    border-radius: 10px;
    font-weight: 700;
    font-size: .86rem;
    padding: 0 .85rem;
    white-space: nowrap;
}
#tab-reconciliation-center .reconcile-three-column-grid {
    align-items: stretch !important;
}
#tab-reconciliation-center .reconcile-column {
    display: grid !important;
    grid-template-rows: repeat(2, 390px) !important;
    gap: .75rem !important;
    align-items: stretch !important;
}
#tab-reconciliation-center .reconcile-column > .recon-section {
    height: 390px !important;
    min-height: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}
#tab-reconciliation-center .recon-section-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
}
#tab-reconciliation-center .recon-scroll-list {
    min-height: 0 !important;
    overflow-y: auto !important;
}
#tab-reconciliation-center .prepaid-recon-module {
    margin-top: .9rem !important;
}
@media (max-width: 1500px) {
    .recon-command-center-new { grid-template-columns: repeat(4, minmax(118px, 1fr)) !important; gap: .65rem !important; }
}
@media (max-width: 900px) {
    #tab-reconciliation-center .reconcile-column { grid-template-rows: none !important; }
    #tab-reconciliation-center .reconcile-column > .recon-section { height: auto !important; max-height: 420px !important; }
}

/* v1.5.1: simplify comparison cards and remove manual settlement selector */
#tab-reconciliation-center .recon-cards-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
#tab-reconciliation-center #comp-diff-chen.color-error,
#tab-reconciliation-center #comp-diff-chen[style*="251"] {
    color: #fb7185 !important;
}
.settlement-type-pill {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:64px;
    padding:.28rem .55rem;
    border-radius:10px;
    font-size:.72rem;
    font-weight:800;
    border:1px solid rgba(255,255,255,.08);
    background:rgba(255,255,255,.045);
    color:rgba(255,255,255,.78);
    white-space:nowrap;
}
.settlement-type-pill.reimburse { color:#fbbf24; border-color:rgba(251,191,36,.22); background:rgba(251,191,36,.08); }
.settlement-type-pill.periodic { color:#cbd5e1; border-color:rgba(148,163,184,.22); background:rgba(148,163,184,.08); }
@media (max-width: 900px) { #tab-reconciliation-center .recon-cards-2 { grid-template-columns:1fr !important; } }

/* v1.5.4: manual entry date picker positioning */
.recon-input-area { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-start; }
.recon-input-area textarea { flex: 1 1 100% !important; min-width: 0 !important; }
.recon-input-area #manual-entry-date { flex: 0 0 140px !important; }
.recon-input-area .voice-input-btn { flex: 0 0 auto !important; }
@media (max-width: 640px) { .recon-input-area #manual-entry-date { flex: 1 1 100% !important; } }

/* v1.5.9: reconciliation compare card 2-row, settle button aligned */
.recon-cards-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.settle-btn-sm { padding:2px 12px; font-size:.72rem; border-radius:8px; background:rgba(251,191,36,.12); color:#fbbf24; border:1px solid rgba(251,191,36,.22); cursor:pointer; white-space:nowrap; line-height:1.6; height:auto; min-width:0; }
.settle-btn-sm:hover { background:rgba(251,191,36,.22); }
.recon-stat-item-with-btn { display:flex !important; align-items:center !important; gap:.45rem !important; padding:0 !important; min-height:0 !important; }
.recon-stat-item-with-btn b { order:0 !important; }
.recon-stat-item-with-btn button { order:1 !important; margin:0 !important; }

/* v1.6.0: completely redesigned reconciliation KPI header */
.recon-kpi-header {
    padding: .75rem 1rem;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
.recon-kpi-row {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}
.recon-kpi-row:first-child { margin-bottom: .75rem; }
.recon-kpi-item {
    flex: 1 1 160px;
    min-width: 140px;
    padding: .6rem .8rem;
    border-radius: 12px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.07);
}
.recon-kpi-item label {
    display: block;
    font-size: .7rem;
    color: rgba(255,255,255,.5);
    margin-bottom: .25rem;
    font-weight: 600;
}
.recon-kpi-item span {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
    color: #fbbf24;
    margin-bottom: .15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.recon-kpi-item small {
    display: block;
    font-size: .65rem;
    color: rgba(255,255,255,.38);
}
@media (max-width: 900px) {
    .recon-kpi-item { flex: 1 1 130px; }
}
/* Remove old recon-command-center-new and recon-kpi-card styles */
.recon-command-center-new { display: none !important; }

/* v1.6.3: reimburse toggle button */
.btn-reimburse-toggle {
    padding: 2px 12px;
    border-radius: 8px;
    font-size: .72rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.6;
    transition: .15s;
}
.btn-reimburse-toggle:hover { background: rgba(251,191,36,.18); }
.btn-reimburse-toggle.reimburse-pending {
    border: 1px solid rgba(148,163,184,.22);
    background: rgba(148,163,184,.08);
    color: rgba(255,255,255,.55);
}
.btn-reimburse-toggle.reimburse-pending:hover { background: rgba(148,163,184,.15); }
.btn-reimburse-toggle.reimburse-done {
    border: 1px solid rgba(52,211,153,.25);
    background: rgba(52,211,153,.08);
    color: #34d399;
}
.btn-reimburse-toggle.reimburse-done:hover { background: rgba(52,211,153,.15); }

/* v1.6.9: restored original ledger row layout */
.ledger-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
}
.ledger-item-row:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateX(2px);
}
.ledger-item-row .item-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    flex: 1;
}
.ledger-item-row .item-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ledger-item-row .item-amount {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    margin-left: auto;
    margin-right: 0.75rem;
}
.ledger-item-row .item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.tag-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}
.tag-badge.mine {
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.25);
    color: #a78bfa;
}
.tag-badge.chen {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #fbbf24;
}
.tag-badge.settle {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: #60a5fa;
}

/* v1.6.1: 报销对账指标分两行显示，避免金额挤压重叠 */
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-card.recon-reimburse-card,
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-card:first-child {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    row-gap: 0.75rem !important;
    column-gap: 1.25rem !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-card.recon-reimburse-card h5,
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-card:first-child h5 {
    grid-column: 1 / -1 !important;
}

/* v1.6.11: 强制隐藏系统采购清单里的“报销”胶囊，兜底旧 JS 缓存 */
#tab-reconciliation-center #sys-details-scroll .settlement-type-pill.reimburse {
    display: none !important;
}

/* v1.6.13: 定期结算统计三段均匀排布 */
#tab-reconciliation-center .periodic-stats-row {
    display: grid !important;
    grid-template-columns: 1fr 0.8fr 1fr !important;
    align-items: stretch !important;
    gap: 0.7rem !important;
    width: 100% !important;
}
#tab-reconciliation-center .periodic-stats-row .recon-stat-item {
    text-align: left !important;
    padding: 0.7rem 0.9rem !important;
}
#tab-reconciliation-center .periodic-stats-row .recon-stat-item span {
    margin-bottom: 0.35rem !important;
}
#tab-reconciliation-center .periodic-stats-row .recon-stat-item b {
    display: block !important;
    font-size: 1.05rem !important;
}
#tab-reconciliation-center .periodic-settle-action {
    align-self: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 0 0.8rem !important;
    font-size: 0.95rem !important;
    border-radius: 14px !important;
    justify-content: center !important;
}

/* v1.6.14: 手工录入底部 3 个操作项一排均匀布置 */
#tab-reconciliation-center .manual-action-row {
    flex: 1 1 100% !important;
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 1.18fr 0.92fr 1.18fr !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
    margin-top: 0.9rem !important;
}
#tab-reconciliation-center .manual-action-row #manual-entry-date,
#tab-reconciliation-center .manual-action-row #btn-parse-manual,
#tab-reconciliation-center .manual-action-row #btn-voice-input {
    width: 100% !important;
    height: 48px !important;
    min-width: 0 !important;
    margin: 0 !important;
}
#tab-reconciliation-center .manual-action-row #manual-entry-date {
    padding: 0 0.55rem !important;
    font-size: 0.82rem !important;
    text-align: center !important;
    overflow: visible !important;
}
#tab-reconciliation-center .manual-action-row #btn-parse-manual {
    border-radius: 12px !important;
    font-size: 0.95rem !important;
}
#tab-reconciliation-center .manual-action-row #btn-voice-input {
    position: static !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 12px !important;
    font-size: 1rem !important;
}
@media (max-width: 640px) {
    #tab-reconciliation-center .manual-action-row {
        display: grid !important;
        grid-template-columns: 1.22fr 0.82fr 1.22fr !important;
        gap: 0.55rem !important;
        align-items: stretch !important;
        margin-top: 1rem !important;
    }
    #tab-reconciliation-center .manual-action-row #manual-entry-date {
        font-size: 0.78rem !important;
        padding: 0 0.35rem !important;
    }
    #tab-reconciliation-center .manual-action-row #btn-voice-input {
        position: static !important;
        inset: auto !important;
        transform: none !important;
        width: 100% !important;
        height: 48px !important;
    }
}

/* v1.6.18: force periodic settlement stats to one row on mobile */
#tab-reconciliation-center .recon-section-body > .periodic-stats-row.recon-stats-2,
#tab-reconciliation-center .periodic-stats-row.recon-stats-2 {
    display: grid !important;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.75fr) minmax(0, 1fr) !important;
    grid-auto-flow: column !important;
    grid-auto-columns: minmax(0, 1fr) !important;
    align-items: stretch !important;
    gap: 0.55rem !important;
    width: 100% !important;
}
#tab-reconciliation-center .periodic-stats-row.recon-stats-2 > * {
    min-width: 0 !important;
    width: 100% !important;
    grid-row: 1 !important;
}
#tab-reconciliation-center .periodic-stats-row.recon-stats-2 .recon-stat-item {
    padding: 0.55rem 0.6rem !important;
    text-align: center !important;
}
#tab-reconciliation-center .periodic-stats-row.recon-stats-2 .recon-stat-item span {
    font-size: 0.7rem !important;
    margin-bottom: 0.25rem !important;
    white-space: nowrap !important;
}
#tab-reconciliation-center .periodic-stats-row.recon-stats-2 .recon-stat-item b {
    font-size: 0.95rem !important;
    white-space: nowrap !important;
}
#tab-reconciliation-center .periodic-stats-row.recon-stats-2 .periodic-settle-action {
    min-width: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 58px !important;
    padding: 0 0.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* v1.6.19: 手工录入类型切换：报销 / 定期结算 */
#tab-reconciliation-center .manual-type-switch {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.55rem !important;
    margin-bottom: 0.75rem !important;
}
#tab-reconciliation-center .manual-type-btn {
    height: 42px !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255,255,255,.12) !important;
    background: rgba(255,255,255,.04) !important;
    color: rgba(255,255,255,.72) !important;
    font-weight: 800 !important;
    font-size: 0.9rem !important;
    cursor: pointer !important;
}
#tab-reconciliation-center .manual-type-btn.active {
    color: #fff !important;
    background: linear-gradient(135deg, rgba(96,165,250,.25), rgba(139,92,246,.20)) !important;
    border-color: rgba(96,165,250,.45) !important;
    box-shadow: 0 0 0 1px rgba(96,165,250,.12) inset !important;
}

/* Color accents for reconciliation modules (一眼识别) */
#tab-reconciliation-center .reconcile-column:nth-child(1) .recon-section {
    border-top: 4px solid #8b5cf6 !important; /* Purple accent */
    border-left: 1px solid rgba(139, 92, 246, 0.15) !important;
    border-right: 1px solid rgba(139, 92, 246, 0.15) !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(1) .recon-section-title {
    background: rgba(139, 92, 246, 0.05) !important;
    color: #c084fc !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(1) .recon-section-title i {
    color: #c084fc !important;
}

#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section {
    border-top: 4px solid #10b981 !important; /* Emerald green accent */
    border-left: 1px solid rgba(16, 185, 129, 0.15) !important;
    border-right: 1px solid rgba(16, 185, 129, 0.15) !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section-title {
    background: rgba(16, 185, 129, 0.05) !important;
    color: #34d399 !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section-title i {
    color: #34d399 !important;
}

#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-section {
    border-top: 4px solid #f59e0b !important; /* Gold/Amber accent */
    border-left: 1px solid rgba(245, 158, 11, 0.15) !important;
    border-right: 1px solid rgba(245, 158, 11, 0.15) !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-section-title {
    background: rgba(245, 158, 11, 0.05) !important;
    color: #fbbf24 !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-section-title i {
    color: #fbbf24 !important;
}

/* Mobile responsive override layouts for iframe embedding (avoid horizontal scroll) */
@media (max-width: 600px) {
    #tab-reconciliation-center .reconcile-three-column-grid {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }
    #tab-reconciliation-center .reconcile-column {
        grid-template-rows: none !important;
    }
    #tab-reconciliation-center .recon-section {
        height: auto !important;
        max-height: none !important;
    }
    /* Let the comparison cards wrap or stack nicely on mobile */
    #tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-card.recon-reimburse-card,
    #tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-card:first-child {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        column-gap: 0.5rem !important;
        row-gap: 0.5rem !important;
    }
    /* Fix periodic stats row on mobile */
    #tab-reconciliation-center .periodic-stats-row.recon-stats-2 {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.4rem !important;
    }
    #tab-reconciliation-center .periodic-stats-row.recon-stats-2 .periodic-settle-action {
        grid-column: span 2 !important;
        height: 38px !important;
        min-height: 38px !important;
    }
    /* KPI items wrapping on mobile */
    .recon-kpi-item {
        flex: 1 1 120px !important;
        min-width: 120px !important;
        padding: 0.5rem !important;
    }
    .recon-kpi-item span {
        font-size: 0.95rem !important;
    }
    /* Avoid horizontal scroll of main wrapper */
    html, body {
        overflow-x: hidden !important;
    }
    .app-container, .main-content {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
}

/* v1.6.20: 手工账本录入模块控制高度，不出现内部上下滑动 */
#tab-reconciliation-center .reconcile-column:first-child .recon-section:first-child {
    overflow: hidden !important;
}
#tab-reconciliation-center .reconcile-column:first-child .recon-section:first-child .recon-section-title {
    height: 58px !important;
    min-height: 58px !important;
}
#tab-reconciliation-center .reconcile-column:first-child .recon-section:first-child .recon-section-body {
    overflow: hidden !important;
    padding: 0.75rem 0.9rem 0.85rem !important;
    gap: 0.5rem !important;
}
#tab-reconciliation-center .reconcile-column:first-child .recon-section:first-child .manual-type-switch {
    margin-bottom: 0.55rem !important;
    gap: 0.5rem !important;
}
#tab-reconciliation-center .reconcile-column:first-child .recon-section:first-child .manual-type-btn {
    height: 38px !important;
    border-radius: 11px !important;
    font-size: 0.82rem !important;
}
#tab-reconciliation-center .reconcile-column:first-child .recon-section:first-child #manual-input-text {
    height: 170px !important;
    min-height: 170px !important;
    max-height: 170px !important;
    padding: 0.75rem !important;
    font-size: 0.88rem !important;
    line-height: 1.45 !important;
}
#tab-reconciliation-center .reconcile-column:first-child .recon-section:first-child .manual-action-row {
    margin-top: 0.65rem !important;
    gap: 0.55rem !important;
}
#tab-reconciliation-center .reconcile-column:first-child .recon-section:first-child .manual-action-row #manual-entry-date,
#tab-reconciliation-center .reconcile-column:first-child .recon-section:first-child .manual-action-row #btn-parse-manual,
#tab-reconciliation-center .reconcile-column:first-child .recon-section:first-child .manual-action-row #btn-voice-input {
    height: 44px !important;
    font-size: 0.78rem !important;
}
@media (max-width: 640px) {
    #tab-reconciliation-center .reconcile-column:first-child .recon-section:first-child {
        height: 360px !important;
    }
    #tab-reconciliation-center .reconcile-column:first-child .recon-section:first-child .recon-section-title {
        height: 56px !important;
        min-height: 56px !important;
    }
    #tab-reconciliation-center .reconcile-column:first-child .recon-section:first-child #manual-input-text {
        height: 165px !important;
        min-height: 165px !important;
        max-height: 165px !important;
    }
}

/* v1.6.21: 系统比对与校核模块排版优化，改成舒展卡片式布局 */
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child {
    min-height: 520px !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-section-body {
    padding: 1.15rem 1.25rem !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-cards-3,
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-cards-2 {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    height: auto !important;
    align-items: stretch !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-card {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0.85rem 1rem !important;
    padding: 1.05rem 1.15rem !important;
    min-height: 178px !important;
    height: auto !important;
    align-content: start !important;
    background: rgba(255,255,255,.035) !important;
    border: 1px solid rgba(255,255,255,.09) !important;
    border-radius: 16px !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04) !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-card h5 {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    margin: 0 0 0.1rem !important;
    padding-bottom: 0.65rem !important;
    border-bottom: 1px solid rgba(255,255,255,.08) !important;
    color: #a78bfa !important;
    font-size: 1.05rem !important;
    line-height: 1.15 !important;
    font-weight: 900 !important;
    letter-spacing: .01em !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-divider {
    display: none !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 0.32rem !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0.15rem 0 !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-row span {
    font-size: 0.76rem !important;
    line-height: 1.1 !important;
    color: rgba(255,255,255,.50) !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-row b {
    font-size: 1.08rem !important;
    line-height: 1.1 !important;
    font-weight: 900 !important;
    letter-spacing: -0.02em !important;
    color: #f8fafc !important;
    white-space: nowrap !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-row.total {
    border-top: 1px solid rgba(255,255,255,.08) !important;
    padding-top: 0.7rem !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-row.total b.color-error,
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-row.total b[style*="251"] {
    color: #fb7185 !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-row.total b.color-ok {
    color: #34d399 !important;
}
@media (max-width: 640px) {
    #tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child {
        min-height: 0 !important;
    }
    #tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-section-body {
        padding: 0.95rem !important;
    }
    #tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-card {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.8rem 0.9rem !important;
        padding: 1rem !important;
        min-height: 0 !important;
    }
}

/* v1.6.22: 历史校核展开详情不内滚，错误提示醒目 */
#tab-reconciliation-center .history-check-head {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0.9rem 1rem !important;
    background: rgba(255,255,255,0.02) !important;
    border: none !important;
    color: #fff !important;
    cursor: pointer !important;
    text-align: left !important;
}
#tab-reconciliation-center .history-check-date {
    font-weight: 800 !important;
    line-height: 1.2 !important;
}
#tab-reconciliation-center .history-check-head-right {
    display: flex !important;
    align-items: center !important;
    gap: 0.65rem !important;
    min-width: 0 !important;
}
#tab-reconciliation-center .history-check-sum {
    font-family: var(--font-mono) !important;
    white-space: nowrap !important;
}
#tab-reconciliation-center .history-check-status {
    font-size: 0.8rem !important;
    line-height: 1.25 !important;
    padding: 0.42rem 0.68rem !important;
    max-width: 12rem !important;
    white-space: normal !important;
    text-align: left !important;
}
#tab-reconciliation-center .history-check-arrow {
    font-size: 0.75rem !important;
    opacity: 0.65 !important;
}
#tab-reconciliation-center .history-check-detail {
    padding: 1rem 1rem 1.1rem !important;
    background: rgba(255,255,255,0.025) !important;
    border-top: 1px solid rgba(255,255,255,0.08) !important;
    font-size: 0.86rem !important;
    max-height: none !important;
    overflow: visible !important;
}
#tab-reconciliation-center .history-check-totals {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.7rem !important;
    margin-bottom: 0.85rem !important;
}
#tab-reconciliation-center .history-check-totals > div {
    padding: 0.75rem 0.85rem !important;
    border-radius: 12px !important;
    background: rgba(255,255,255,0.04) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
}
#tab-reconciliation-center .history-check-totals span {
    display: block !important;
    color: rgba(255,255,255,.55) !important;
    font-size: 0.78rem !important;
    margin-bottom: 0.32rem !important;
}
#tab-reconciliation-center .history-check-totals strong {
    font-size: 1.05rem !important;
    font-family: var(--font-mono) !important;
}
#tab-reconciliation-center .history-check-alert {
    margin: 0.85rem 0 !important;
    padding: 0.8rem 0.95rem !important;
    border-radius: 12px !important;
    font-weight: 900 !important;
    font-size: 0.95rem !important;
    line-height: 1.45 !important;
}
#tab-reconciliation-center .history-check-alert.fail {
    color: #fecaca !important;
    background: rgba(239,68,68,.14) !important;
    border: 1px solid rgba(239,68,68,.30) !important;
}
#tab-reconciliation-center .history-check-alert.ok {
    color: #bbf7d0 !important;
    background: rgba(34,197,94,.12) !important;
    border: 1px solid rgba(34,197,94,.28) !important;
}
#tab-reconciliation-center .history-check-meta {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 0.75rem !important;
    color: var(--text-secondary) !important;
    font-size: 0.76rem !important;
    flex-wrap: wrap !important;
}
#tab-reconciliation-center .history-check-meta .btn-check-delete-link {
    color: var(--red-accent) !important;
    text-decoration: none !important;
    font-weight: 800 !important;
}
@media (max-width: 640px) {
    #tab-reconciliation-center .history-check-head {
        grid-template-columns: 1fr !important;
        gap: 0.65rem !important;
    }
    #tab-reconciliation-center .history-check-head-right {
        width: 100% !important;
        justify-content: space-between !important;
    }
    #tab-reconciliation-center .history-check-status {
        max-width: 10rem !important;
        font-size: 0.76rem !important;
    }
    #tab-reconciliation-center .history-check-totals {
        grid-template-columns: 1fr !important;
    }
}

/* v1.6.26: 手工侧只显示同步状态，系统侧负责状态修改 */
#tab-reconciliation-center .manual-sync-status {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.22rem 0.48rem !important;
    border-radius: 999px !important;
    font-size: 0.68rem !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    border: 1px solid rgba(255,255,255,.10) !important;
}
#tab-reconciliation-center .manual-sync-status.done {
    color: #34d399 !important;
    background: rgba(52,211,153,.10) !important;
    border-color: rgba(52,211,153,.26) !important;
}
#tab-reconciliation-center .manual-sync-status.pending {
    color: #fbbf24 !important;
    background: rgba(251,191,36,.10) !important;
    border-color: rgba(251,191,36,.24) !important;
}
#tab-reconciliation-center .manual-sync-status.warn {
    color: #fb7185 !important;
    background: rgba(251,113,133,.10) !important;
    border-color: rgba(251,113,133,.26) !important;
}
#tab-reconciliation-center .sys-status-toggle {
    border: 1px solid rgba(255,255,255,.12) !important;
    border-radius: 999px !important;
    padding: 0.28rem 0.65rem !important;
    font-size: 0.72rem !important;
    font-weight: 900 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    background: rgba(255,255,255,.04) !important;
}
#tab-reconciliation-center .sys-status-toggle.done {
    color: #34d399 !important;
    background: rgba(52,211,153,.11) !important;
    border-color: rgba(52,211,153,.30) !important;
}
#tab-reconciliation-center .sys-status-toggle.pending {
    color: #fbbf24 !important;
    background: rgba(251,191,36,.10) !important;
    border-color: rgba(251,191,36,.28) !important;
}
#tab-reconciliation-center .sys-status-toggle:hover {
    filter: brightness(1.12) !important;
}
#tab-reconciliation-center #ledger-items-container .ledger-item-row .item-info {
    flex-wrap: wrap !important;
}

/* v1.6.27: 系统清单状态按钮放到金额上方，右侧对齐 */
#tab-reconciliation-center #sys-details-scroll .detail-item-row .sys-item-right {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    justify-content: center !important;
    gap: 0.42rem !important;
    min-width: 6.8rem !important;
    margin-left: 0.75rem !important;
}
#tab-reconciliation-center #sys-details-scroll .detail-item-row .sys-item-right .status-line {
    display: block !important;
    margin: 0 !important;
}
#tab-reconciliation-center #sys-details-scroll .detail-item-row .sys-item-right .value {
    margin: 0 !important;
    text-align: right !important;
}

/* v1.6.28: 系统清单显示报销/定期类型 */
#tab-reconciliation-center #sys-details-scroll .sys-type-pill {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 2.4rem !important;
    margin-right: 0.45rem !important;
    padding: 0.16rem 0.42rem !important;
    border-radius: 8px !important;
    font-size: 0.68rem !important;
    font-weight: 900 !important;
    vertical-align: middle !important;
}
#tab-reconciliation-center #sys-details-scroll .sys-type-pill.reimburse {
    color: #fbbf24 !important;
    background: rgba(251,191,36,.10) !important;
    border: 1px solid rgba(251,191,36,.26) !important;
}
#tab-reconciliation-center #sys-details-scroll .sys-type-pill.periodic {
    color: #60a5fa !important;
    background: rgba(96,165,250,.10) !important;
    border: 1px solid rgba(96,165,250,.26) !important;
}

/* v1.7.2 手机端综合优化：系统比对、历史校核、经营日报 */
@media (max-width: 768px) {
    /* 对账模块三列改为单列，每列不限制高度 */
    #tab-reconciliation-center .reconcile-three-column-grid {
        grid-template-columns: 1fr !important;
        gap: 0.8rem !important;
    }
    #tab-reconciliation-center .reconcile-column {
        grid-template-rows: none !important;
        gap: 0.75rem !important;
    }
    #tab-reconciliation-center .recon-section {
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        visibility: visible !important;
    }
    #tab-reconciliation-center .recon-section-body {
        overflow: visible !important;
        padding: 0.8rem !important;
    }

    /* 手工录入高度放活 */
    #tab-reconciliation-center .reconcile-column:first-child .recon-section:first-child {
        height: auto !important;
    }
    #tab-reconciliation-center .reconcile-column:first-child .recon-section:first-child #manual-input-text {
        height: 140px !important;
        min-height: 140px !important;
        max-height: 140px !important;
    }

    /* 系统比对卡片更窄更韧 */
    #tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child {
        min-height: 0 !important;
    }
    #tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-card {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.6rem 0.75rem !important;
        padding: 0.9rem !important;
        min-height: 0 !important;
    }
    #tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-card h5 {
        font-size: 0.92rem !important;
        margin-bottom: 0.3rem !important;
        padding-bottom: 0.55rem !important;
    }
    #tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-row {
        gap: 0.25rem !important;
    }
    #tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-row span {
        font-size: 0.7rem !important;
    }
    #tab-reconciliation-center .reconcile-column:nth-child(2) .recon-section:first-child .recon-mini-row b {
        font-size: 0.95rem !important;
    }

    /* 系统采购清单右侧紧凑 */
    #tab-reconciliation-center #sys-details-scroll .detail-item-row .sys-item-right {
        min-width: 5.6rem !important;
        gap: 0.32rem !important;
    }
    #tab-reconciliation-center #sys-details-scroll .detail-item-row .name {
        font-size: 0.82rem !important;
    }
    .sys-type-pill {
        padding: 0.12rem 0.35rem !important;
        font-size: 0.64rem !important;
    }

    /* 历史校核：两色合计叠放，alert 小字 */
    #tab-reconciliation-center .history-check-detail {
        padding: 0.9rem !important;
    }
    #tab-reconciliation-center .history-check-totals {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem !important;
    }
    #tab-reconciliation-center .history-check-totals > div {
        padding: 0.6rem 0.7rem !important;
    }
    #tab-reconciliation-center .history-check-totals span {
        font-size: 0.7rem !important;
    }
    #tab-reconciliation-center .history-check-totals strong {
        font-size: 0.9rem !important;
    }
    #tab-reconciliation-center .history-check-alert {
        font-size: 0.84rem !important;
        padding: 0.7rem 0.8rem !important;
    }

    /* 经营日报卡片更多内边，数字不裁切 */
    .daily-report-text {
        font-size: 0.76rem !important;
        line-height: 1.45 !important;
    }
    .rpt-kpi-row {
        gap: 0.35rem !important;
    }
    .rpt-kpi-item {
        padding: 0.4rem 0.35rem !important;
    }
    .rpt-kpi-item span {
        font-size: 0.6rem !important;
    }
    .rpt-num {
        font-size: 0.76rem !important;
    }
    .rpt-insight {
        font-size: 0.74rem !important;
        gap: 0.35rem !important;
    }

    /* 统一禁止任何内容撑出屏幕 */
    .recon-scroll-list,
    #sys-details-scroll,
    #periodic-outstanding-list,
    #ledger-items-container,
    #historical-checks-list {
        max-height: none !important;
        overflow-y: visible !important;
    }
    .recon-section,
    .recon-section-body,
    .recon-cards-3,
    .recon-cards-2 {
        overflow: visible !important;
    }
}

/* v1.7.3 系统比对卡片结构重写，手机端稳定两列 */
#tab-reconciliation-center .recon-cards-2 {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.85rem !important;
    height: auto !important;
    align-items: stretch !important;
}
#tab-reconciliation-center .recon-cards-2 .recon-compare-card {
    border-radius: 16px !important;
    border: 1px solid rgba(255,255,255,.09) !important;
    background: rgba(255,255,255,.032) !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.55rem 0.8rem !important;
    padding: 0.95rem !important;
    align-content: start !important;
    min-height: 0 !important;
}
#tab-reconciliation-center .recon-compare-card h5 {
    grid-column: 1 / -1 !important;
    margin: 0 0 0.35rem !important;
    padding-bottom: 0.6rem !important;
    border-bottom: 1px solid rgba(255,255,255,.08) !important;
    color: #a78bfa !important;
    font-size: 1rem !important;
    line-height: 1.15 !important;
    font-weight: 900 !important;
}
#tab-reconciliation-center .recon-compare-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.28rem !important;
}
#tab-reconciliation-center .recon-compare-item span {
    font-size: 0.7rem !important;
    color: rgba(255,255,255,.48) !important;
    font-weight: 800 !important;
}
#tab-reconciliation-center .recon-compare-item b {
    font-size: 0.92rem !important;
    font-weight: 900 !important;
    color: #f8fafc !important;
    font-family: var(--font-mono) !important;
}
#tab-reconciliation-center .recon-compare-divider {
    grid-column: 1 / -1 !important;
    height: 1px !important;
    background: rgba(255,255,255,.08) !important;
}
#tab-reconciliation-center .recon-compare-diff b.color-error,
#tab-reconciliation-center .recon-compare-diff b[style*="251"] {
    color: #fb7185 !important;
}
#tab-reconciliation-center .recon-compare-diff b.color-ok {
    color: #34d399 !important;
}

@media (max-width: 768px) {
    #tab-reconciliation-center .recon-cards-2 {
        grid-template-columns: 1fr !important;
        gap: 0.7rem !important;
    }
    #tab-reconciliation-center .recon-compare-card {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.5rem 0.65rem !important;
        padding: 0.8rem !important;
    }
    #tab-reconciliation-center .recon-compare-item span {
        font-size: 0.66rem !important;
    }
    #tab-reconciliation-center .recon-compare-item b {
        font-size: 0.82rem !important;
    }
}

/* v1.7.9 系统比对与校核：取消卡片内滚动，一张卡片完整显示 */
#tab-reconciliation-center .reconcile-column:nth-child(2) > .recon-section:first-child {
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) > .recon-section:first-child .recon-section-body {
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
    padding: 0.75rem !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) > .recon-section:first-child .recon-cards-2 {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0.65rem !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) > .recon-section:first-child .recon-compare-card {
    padding: 0.75rem !important;
    border-radius: 14px !important;
    gap: 0.42rem 0.7rem !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) > .recon-section:first-child .recon-compare-card h5 {
    font-size: 0.9rem !important;
    padding-bottom: 0.42rem !important;
    margin-bottom: 0.15rem !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) > .recon-section:first-child .recon-compare-item span {
    font-size: 0.64rem !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) > .recon-section:first-child .recon-compare-item b {
    font-size: 0.78rem !important;
    line-height: 1.15 !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) > .recon-section:first-child .recon-compare-divider {
    margin: 0.05rem 0 !important;
}

/* 首页营业日报：校核摘要允许换行，不撑坏卡片 */
.rpt-kpi-item.rpt-kpi-wide {
    grid-column: 1 / -1 !important;
}
.rpt-kpi-item.rpt-kpi-wide .rpt-num {
    white-space: normal !important;
    line-height: 1.35 !important;
    font-size: 0.82rem !important;
}
@media (max-width: 768px) {
    #tab-reconciliation-center .reconcile-column:nth-child(2) > .recon-section:first-child .recon-section-title {
        padding: 0.85rem 1rem !important;
        font-size: 1rem !important;
    }
    #tab-reconciliation-center .reconcile-column:nth-child(2) > .recon-section:first-child .recon-compare-card {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* 盈亏分析-股东权益：统一为首页可读字号 */
#profit-partners-list,
#profit-partners-list .partner-card,
#profit-partners-list table,
#profit-partners-list input,
#profit-partners-list select,
#profit-partners-list button {
    font-size: 1rem !important;
}
#profit-partners-list .partner-card {
    padding: 1.15rem !important;
}
#profit-partners-list .partner-card span,
#profit-partners-list .partner-card div,
#profit-partners-list .partner-card td,
#profit-partners-list .partner-card th {
    font-size: 1rem !important;
    line-height: 1.35 !important;
}
#profit-partners-list .font-mono {
    font-size: 1.05rem !important;
}
#profit-partners-list input,
#profit-partners-list select {
    min-height: 38px !important;
    padding: .5rem .65rem !important;
}
#profit-partners-list table th,
#profit-partners-list table td {
    padding: .5rem .65rem !important;
}
#profit-partners-list button {
    min-height: 34px !important;
    padding: .35rem .75rem !important;
}
@media (max-width: 1100px) {
    #profit-partners-list > div[style*="grid-template-columns: minmax"] {
        grid-template-columns: 1fr !important;
    }
}

/* 亏损金额统一爆红显示 */
.text-danger,
.loss-strong,
#tab-profit-analysis .loss-strong,
#profit-kpis .cockpit-kpi b[style*="#fb7185"] {
    color: #ef4444 !important;
    text-shadow: 0 0 12px rgba(239, 68, 68, 0.28) !important;
}

/* 股东垫付明细：保存后作为紧凑列表显示，金额不被数字框箭头遮挡，明细区独立滚动 */
#profit-partners-list .partner-advance-scroll {
    max-height: 180px;
    overflow-y: auto;
    padding-right: 2px;
}
#profit-partners-list .partner-advance-table,
#profit-partners-list .partner-advance-table th,
#profit-partners-list .partner-advance-table td {
    font-size: 0.82rem !important;
    line-height: 1.25 !important;
}
#profit-partners-list .partner-advance-input {
    min-height: 30px !important;
    height: 30px !important;
    padding: 0.28rem 0.45rem !important;
    font-size: 0.82rem !important;
}
#profit-partners-list .partner-advance-table button {
    min-height: 28px !important;
    padding: 3px 7px !important;
    font-size: 0.72rem !important;
}
#profit-partners-list .partner-advance-date,
#profit-partners-list .partner-advance-amount {
    font-size: 0.82rem !important;
    line-height: 1.25 !important;
}
#profit-partners-list .partner-advance-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 17px;
    padding: 0 0.28rem;
    border-radius: 999px;
    background: rgba(167, 139, 250, 0.12);
    border: 1px solid rgba(167, 139, 250, 0.22);
    color: #c4b5fd;
    font-size: 0.56rem !important;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}
#profit-partners-list .basemat-recharge-scroll {
    max-height: 185px;
    overflow-y: auto;
    padding-right: 2px;
    flex: 1 1 auto;
    min-height: 0;
}
#profit-partners-list .basemat-recharge-table,
#profit-partners-list .basemat-recharge-table th,
#profit-partners-list .basemat-recharge-table td,
#profit-partners-list .basemat-recharge-text,
#profit-partners-list .basemat-recharge-amount {
    font-size: 0.86rem !important;
    line-height: 1.25 !important;
}
#profit-partners-list .basemat-recharge-input {
    min-height: 32px !important;
    height: 32px !important;
    padding: 0.32rem 0.45rem !important;
    font-size: 0.86rem !important;
}

/* 历史校核记录：固定为列表内上下滑动，避免卡片裁半截 */
#tab-reconciliation-center #historical-checks-list {
    height: 430px !important;
    max-height: 430px !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.65rem !important;
    padding: 0.65rem 0.75rem 0.85rem !important;
}
#tab-reconciliation-center #historical-checks-list > .accordion-item {
    flex: 0 0 auto !important;
    overflow: visible !important;
    margin-bottom: 0 !important;
}
#tab-reconciliation-center #historical-checks-list .history-check-head {
    min-height: 64px !important;
    overflow: visible !important;
}
#tab-reconciliation-center #historical-checks-list .history-check-head-right {
    flex-wrap: nowrap !important;
}
#tab-reconciliation-center #historical-checks-list .history-check-status {
    white-space: nowrap !important;
    max-width: none !important;
}

/* 系统比对与校核：差异单行显示，避免占两行挤压下方 */
#tab-reconciliation-center .reconcile-column:nth-child(2) > .recon-section:first-child .recon-compare-card {
    row-gap: 0.36rem !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) > .recon-section:first-child .recon-compare-diff {
    grid-column: 1 / -1 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.8rem !important;
    min-height: 1.65rem !important;
    padding-top: 0.08rem !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) > .recon-section:first-child .recon-compare-diff span {
    font-size: 0.68rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) > .recon-section:first-child .recon-compare-diff b {
    font-size: 0.86rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    text-align: right !important;
}

/* 系统比对与校核：进一步压缩高度，保留清晰字号 */
#tab-reconciliation-center .reconcile-column:nth-child(2) > .recon-section:first-child .recon-section-body {
    padding: 0.55rem 0.7rem !important;
    gap: 0.5rem !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) > .recon-section:first-child .recon-cards-2 {
    gap: 0.5rem !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) > .recon-section:first-child .recon-compare-card {
    padding: 0.62rem 0.7rem !important;
    gap: 0.3rem 0.75rem !important;
    border-radius: 13px !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) > .recon-section:first-child .recon-compare-card h5 {
    font-size: 0.94rem !important;
    padding-bottom: 0.34rem !important;
    margin-bottom: 0.05rem !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) > .recon-section:first-child .recon-compare-item {
    gap: 0.18rem !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) > .recon-section:first-child .recon-compare-item span {
    font-size: 0.66rem !important;
    line-height: 1.05 !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) > .recon-section:first-child .recon-compare-item b {
    font-size: 0.84rem !important;
    line-height: 1.08 !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) > .recon-section:first-child .recon-compare-divider {
    margin: 0 !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(2) > .recon-section:first-child .recon-compare-diff {
    min-height: 1.35rem !important;
    padding-top: 0 !important;
}

/* 营业日报：财务校核异常统一红色 */
.rpt-kpi-item.rpt-check-danger {
    border-color: rgba(239, 68, 68, 0.34) !important;
    background: rgba(239, 68, 68, 0.08) !important;
}
.rpt-kpi-item.rpt-check-danger .rpt-num {
    color: #ef4444 !important;
    text-shadow: 0 0 12px rgba(239, 68, 68, 0.22) !important;
}
.rpt-kpi-item.rpt-check-ok .rpt-num {
    color: #34d399 !important;
}

/* 定期结算分类：只有当前选中项高亮 */
#tab-reconciliation-center #periodic-category-chips [data-periodic-cat] {
    background: transparent !important;
    border-color: rgba(148, 163, 184, 0.28) !important;
    color: #cbd5e1 !important;
    box-shadow: none !important;
}
#tab-reconciliation-center #periodic-category-chips [data-periodic-cat].active {
    background: rgba(37, 99, 235, 0.22) !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 1px rgba(59,130,246,.25), 0 8px 20px rgba(37,99,235,.18) !important;
}

/* 定期结算：按钮放分类旁，金额笔数一行，给明细更多空间 */
#tab-reconciliation-center #periodic-category-chips {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 0.45rem !important;
}
#tab-reconciliation-center #periodic-category-chips .periodic-settle-action,
#tab-reconciliation-center #periodic-category-chips .periodic-unsettle-action {
    min-height: 34px !important;
    padding: 0.32rem 0.72rem !important;
    font-size: 0.82rem !important;
    border-radius: 12px !important;
    white-space: nowrap !important;
}
#tab-reconciliation-center #periodic-category-chips .periodic-unsettle-action {
    color: #fca5a5 !important;
    border-color: rgba(239, 68, 68, 0.28) !important;
    background: rgba(239, 68, 68, 0.08) !important;
}
#tab-reconciliation-center .periodic-stats-row {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.55rem !important;
    margin: 0.15rem 0 !important;
}
#tab-reconciliation-center .periodic-stats-row .recon-stat-item {
    min-height: 56px !important;
    padding: 0.55rem 0.7rem !important;
}

/* 定期结算专区最终布局：分类、结算、反结算同一行；统计左右一行 */
#tab-reconciliation-center .reconcile-column:nth-child(3) #periodic-category-chips {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 0.42rem !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding-bottom: 0.15rem !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(3) #periodic-category-chips .recon-chip {
    flex: 0 0 auto !important;
    min-width: auto !important;
    height: 34px !important;
    padding: 0 0.78rem !important;
    font-size: 0.82rem !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(3) #periodic-category-chips .periodic-settle-action,
#tab-reconciliation-center .reconcile-column:nth-child(3) #periodic-category-chips .periodic-unsettle-action {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: auto !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 0.72rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.8rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}
#tab-reconciliation-center .periodic-stats-row.recon-stats-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.5rem !important;
    margin: 0.05rem 0 0.15rem !important;
}
#tab-reconciliation-center .periodic-stats-row.recon-stats-2 .recon-stat-item {
    min-height: 42px !important;
    height: 42px !important;
    padding: 0.42rem 0.65rem !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.5rem !important;
    text-align: left !important;
}
#tab-reconciliation-center .periodic-stats-row.recon-stats-2 .recon-stat-item span {
    display: inline !important;
    margin: 0 !important;
    font-size: 0.72rem !important;
    white-space: nowrap !important;
}
#tab-reconciliation-center .periodic-stats-row.recon-stats-2 .recon-stat-item b {
    display: inline !important;
    font-size: 0.9rem !important;
    white-space: nowrap !important;
    text-align: right !important;
}

/* 定期结算：结算/反结算合并为一个按钮 */
#tab-reconciliation-center .reconcile-column:nth-child(3) #periodic-category-chips .periodic-settle-action.periodic-unsettle-action {
    color: #fca5a5 !important;
    border-color: rgba(239, 68, 68, 0.28) !important;
    background: rgba(239, 68, 68, 0.08) !important;
}
#tab-reconciliation-center .reconcile-column:nth-child(3) #periodic-category-chips .periodic-settle-action:disabled {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
}

/* Income monthly compare final layout guard: override old income grid fixed heights */
#tab-income-analysis .analysis-grid.grid-3.income-monthly-compare-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    align-items: start !important;
    gap: 1rem !important;
    grid-auto-rows: auto !important;
}
#tab-income-analysis .analysis-grid.grid-3.income-monthly-compare-grid > .card-block.glass {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    align-self: start !important;
}
#tab-income-analysis .analysis-grid.grid-3.income-monthly-compare-grid > .card-block.glass > div {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
}
#tab-income-analysis .analysis-grid.grid-3.income-monthly-compare-grid #income-month-trend {
    height: 420px !important;
    min-height: 420px !important;
    max-height: none !important;
    overflow: hidden !important;
}
#tab-income-analysis .analysis-grid.grid-3.income-monthly-compare-grid #income-period-month-trend,
#tab-income-analysis .analysis-grid.grid-3.income-monthly-compare-grid #income-channel-month-trend,
#tab-income-analysis .analysis-grid.grid-3.income-monthly-compare-grid #income-mom-cards,
#tab-income-analysis .analysis-grid.grid-3.income-monthly-compare-grid #income-period-weekday-all,
#tab-income-analysis .analysis-grid.grid-3.income-monthly-compare-grid #income-month-weekday {
    height: auto !important;
    min-height: 420px !important;
    max-height: none !important;
    overflow: visible !important;
}
@media (max-width: 1280px) {
    #tab-income-analysis .analysis-grid.grid-3.income-monthly-compare-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Shewei finance native module — 整个 tab 撑满可视高度，内部按比例分配，不产生整页滚动 */
#tab-shewei-finance.tab-panel.active { display:flex; flex-direction:column; flex:1 1 auto; min-height:0; height:100%; }
.shewei-native-shell { display:flex; flex-direction:column; gap:.7rem; flex:1 1 auto; min-height:0; }
.shewei-toolbar { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:1rem 1.15rem; border-radius:18px; border:1px solid rgba(255,255,255,.10); }
.shewei-toolbar h2 { margin:0; font-size:1.12rem; font-weight:900; color:#f8fafc; }
.shewei-toolbar p { margin:.25rem 0 0; color:rgba(226,232,240,.58); font-size:.78rem; }
.shewei-toolbar-actions-only { display:none !important; }
.shewei-kpi-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:1rem; flex:0 0 auto; }
.shewei-kpi { padding:1rem; border-radius:16px; border:1px solid rgba(255,255,255,.10); background:rgba(255,255,255,.04); }
.shewei-kpi label { display:block; color:rgba(226,232,240,.62); font-size:.74rem; margin-bottom:.35rem; }
.shewei-kpi b { display:block; font-size:1.05rem; font-weight:900; font-variant-numeric:tabular-nums; }
.shewei-kpi small { display:block; color:rgba(226,232,240,.45); font-size:.68rem; margin-top:.28rem; }
.shewei-kpi button { margin-top:.35rem; border:0; background:transparent; color:#60a5fa; cursor:pointer; font-size:.7rem; padding:0; }
.shewei-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:1.4fr 1fr; gap:1rem; flex:1 1 auto; min-height:0; }
.shewei-card { border-radius:18px; border:1px solid rgba(255,255,255,.10); background:rgba(255,255,255,.035); overflow:hidden; min-height:0; }
.shewei-wide { grid-column:1 / -1; }
.shewei-card-head { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.9rem 1rem; border-bottom:1px solid rgba(255,255,255,.08); }
.shewei-card-head h3 { margin:0; font-size:.94rem; font-weight:900; color:#e2e8f0; }
.shewei-card-head button { border:0; background:rgba(96,165,250,.12); color:#93c5fd; border-radius:999px; padding:.36rem .72rem; cursor:pointer; font-size:.75rem; }
.shewei-table-wrap { overflow-x:auto; }
.shewei-table { width:100%; border-collapse:collapse; font-size:.78rem; }
.shewei-table th { color:rgba(226,232,240,.50); font-weight:800; text-align:left; background:rgba(255,255,255,.035); padding:.55rem .65rem; white-space:nowrap; }
.shewei-table td { border-top:1px solid rgba(255,255,255,.06); padding:.46rem .65rem; color:#e2e8f0; }
.shewei-table tfoot td { font-weight:900; color:#fbbf24; background:rgba(251,191,36,.06); }
.shewei-table .num, .shewei-table td:nth-child(2) { text-align:right; font-variant-numeric:tabular-nums; }
.shewei-table input, .shewei-table select { width:100%; border:1px solid rgba(255,255,255,.10); background:rgba(15,23,42,.72); color:#f8fafc; border-radius:8px; padding:.36rem .45rem; font-size:.76rem; outline:none; }
.shewei-table input[type="number"] { text-align:right; min-width:94px; }
.shewei-table input[type="checkbox"] { width:16px; height:16px; min-width:16px; }
.shewei-table button { border:0; background:transparent; color:#fb7185; cursor:pointer; font-size:1rem; }
.shewei-table tr.is-advance td { background:rgba(251,191,36,.05); }
.shewei-table tr.is-reimbursed td { opacity:.62; background:rgba(52,211,153,.05); }

/* 两栏等高：由 grid 行高统一撑满，卡片本身不再限死高度，内容不够就留白，太多就内部滚动 */
.shewei-equal-card, .shewei-advance-card { display:flex; flex-direction:column; height:100%; min-height:0; }
.shewei-equal-card .shewei-table-wrap, .shewei-advance-card .shewei-table-wrap { flex:1 1 auto; min-height:0; }
.shewei-table-wrap.shewei-scroll { overflow-y:auto; }
.shewei-card-foot { display:flex; align-items:center; justify-content:space-between; padding:.55rem 1rem; border-top:1px solid rgba(255,255,255,.08); background:rgba(251,191,36,.06); font-weight:900; font-size:.82rem; font-variant-numeric:tabular-nums; flex:0 0 auto; }
.shewei-card-foot .num { color:#fbbf24; }
.shewei-native-shell .shewei-card-foot span:first-child { font-weight:800; color:rgba(226,232,240,.65); font-size:.72rem; }

/* 支出按月份胶囊收纳：胶囊行选月份，下方只显示选中月份的支出 */
.shewei-month-chip-row { padding:.7rem 1rem .65rem; margin:0; border-bottom:1px solid rgba(255,255,255,.08); }
.shewei-native-shell .pos { color:#34d399 !important; }
.shewei-native-shell .neg { color:#fb7185 !important; }
.shewei-native-shell .warn { color:#fbbf24 !important; }
@media (max-width: 1100px) {
    .shewei-kpi-grid, .shewei-grid { grid-template-columns:1fr; }
    .shewei-wide { grid-column:auto; }
    /* 窄屏放弃"一屏塞满"，改回正常整页滚动，卡片按内容自然展开 */
    #tab-shewei-finance.tab-panel.active { display:block; height:auto; flex:none; }
    .shewei-native-shell { flex:none; }
    .shewei-grid { grid-template-rows:none; flex:none; }
    .shewei-equal-card, .shewei-advance-card { height:auto; max-height:56vh; }
}

/* Contract management native module */
.contract-native-shell { display:flex; flex-direction:column; gap:1rem; }
.contract-toolbar { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:1rem 1.15rem; border-radius:18px; border:1px solid rgba(255,255,255,.10); }
.contract-toolbar h2 { margin:0; font-size:1.12rem; font-weight:900; color:#f8fafc; }
.contract-toolbar p { margin:.25rem 0 0; color:rgba(226,232,240,.58); font-size:.78rem; }
.contract-toolbar-actions-only { display:none !important; }
.contract-actions { display:flex; gap:.6rem; flex-wrap:wrap; justify-content:flex-end; }
.header-module-actions { display:flex; align-items:center; justify-content:flex-end; gap:.6rem; }
.contract-summary { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:1rem; }
.contract-metric { padding:1rem; border-radius:16px; border:1px solid rgba(255,255,255,.10); background:rgba(255,255,255,.04); }
.contract-metric label { display:block; font-size:.72rem; color:rgba(226,232,240,.55); margin-bottom:.35rem; }
.contract-metric b { color:#e2e8f0; font-weight:900; font-size:.98rem; font-variant-numeric:tabular-nums; }
.contract-metric.primary b { color:#fbbf24; }
.contract-kpi-analysis { grid-column:1 / -1; padding:.9rem 1rem; border-radius:16px; border:1px solid rgba(255,255,255,.10); background:linear-gradient(90deg, rgba(56,189,248,.10), rgba(255,255,255,.035)); display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.75rem; }
.contract-kpi-analysis div { display:flex; align-items:flex-start; gap:.45rem; color:rgba(226,232,240,.82); font-size:.82rem; line-height:1.45; }
.contract-kpi-analysis span { width:7px; height:7px; border-radius:50%; background:#60a5fa; margin-top:.45rem; flex:0 0 auto; }
.contract-controls { display:grid; grid-template-columns:auto minmax(220px,360px) minmax(240px,1fr); gap:.75rem; align-items:center; padding:.85rem; border-radius:16px; border:1px solid rgba(255,255,255,.10); }
.contract-seg { display:flex; background:rgba(255,255,255,.06); border-radius:999px; padding:3px; }
.contract-seg button { border:0; background:transparent; color:rgba(226,232,240,.65); padding:.46rem .78rem; border-radius:999px; cursor:pointer; font-weight:800; }
.contract-seg button.active { background:#fbbf24; color:#111827; }
.contract-controls select, .contract-controls input { border:1px solid rgba(255,255,255,.10); background:rgba(15,23,42,.72); color:#f8fafc; border-radius:12px; padding:.72rem .85rem; outline:none; font-size:.92rem; font-weight:700; }
.contract-controls input::placeholder { color:rgba(226,232,240,.42); font-weight:600; }
.contract-list { display:flex; flex-direction:column; gap:.75rem; }
.contract-row-card { display:grid; grid-template-columns:minmax(260px,1.5fr) repeat(4,minmax(90px,.6fr)) auto; gap:.75rem; align-items:center; padding:1rem; border-radius:18px; border:1px solid rgba(255,255,255,.10); cursor:pointer; position:relative; overflow:hidden; }
.contract-row-card:hover { border-color:rgba(96,165,250,.45); background:rgba(255,255,255,.055); }
.contract-row-main b { display:block; color:#f8fafc; font-size:.92rem; }
.contract-row-main span, .contract-row-card label { display:block; color:rgba(226,232,240,.52); font-size:.7rem; margin-top:.25rem; }
.contract-row-card div > b { color:#fbbf24; font-variant-numeric:tabular-nums; }
.contract-row-card em { font-style:normal; border-radius:999px; padding:.32rem .58rem; background:rgba(251,191,36,.12); color:#fbbf24; font-size:.7rem; font-weight:900; white-space:nowrap; }
.contract-row-card.done { opacity:.54; filter:saturate(.45); background:rgba(148,163,184,.055) !important; border-color:rgba(148,163,184,.14) !important; }
.contract-row-card.done .contract-row-main b,
.contract-row-card.done div > b { color:rgba(226,232,240,.55) !important; }
.contract-row-card.done em { background:rgba(148,163,184,.14); color:#cbd5e1; }
.contract-row-card.done .contract-progress span { background:#64748b; }
.contract-row-card.danger em { background:rgba(251,113,133,.12); color:#fb7185; }
.contract-progress { grid-column:1 / -1; height:8px; border-radius:999px; overflow:hidden; background:rgba(255,255,255,.08); }
.contract-progress span { display:block; height:100%; background:linear-gradient(90deg,#38bdf8,#34d399); }
.contract-single { padding:1rem; border-radius:18px; border:1px solid rgba(255,255,255,.10); }
.contract-single-head { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; margin-bottom:1rem; }
.contract-single-head h3 { margin:0; color:#f8fafc; font-size:1.05rem; }
.contract-single-head p { margin:.3rem 0 0; color:rgba(226,232,240,.55); font-size:.76rem; }
.contract-single-head > div:last-child { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:.5rem; }
.contract-ratio-action { color:#fde68a !important; border-color:rgba(251,191,36,.28) !important; background:rgba(251,191,36,.09) !important; }
.contract-single-stats { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:.75rem; margin-bottom:1rem; }
.contract-single-stats span, .contract-single-stats em { border:1px solid rgba(255,255,255,.08); background:rgba(255,255,255,.04); border-radius:14px; padding:.75rem; color:rgba(226,232,240,.58); font-style:normal; }
.contract-single-stats b { display:block; color:#fbbf24; margin-top:.25rem; }
.contract-single-stats em { color:#fbbf24; font-weight:900; display:flex; align-items:center; justify-content:center; }
.contract-node-list { display:flex; flex-direction:column; gap:.6rem; }
.contract-node { display:grid; grid-template-columns:minmax(220px,1fr) 110px 110px 110px auto; gap:.65rem; align-items:center; padding:.8rem; border-radius:14px; background:rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.07); }
.contract-node b { color:#f8fafc; }
.contract-node span { display:block; color:rgba(226,232,240,.48); font-size:.7rem; margin-top:.25rem; }
.contract-node strong { color:#fbbf24; font-variant-numeric:tabular-nums; }
.contract-node em { color:rgba(226,232,240,.65); font-style:normal; font-size:.72rem; }
.contract-node button { border:0; background:rgba(96,165,250,.12); color:#93c5fd; border-radius:999px; padding:.4rem .7rem; cursor:pointer; }
.contract-audit-panel { margin-top:1rem; border-top:1px solid rgba(148,163,184,.16); padding-top:.9rem; display:flex; flex-direction:column; gap:.5rem; }
.contract-audit-panel h4 { margin:0 0 .2rem; color:#f8fafc; font-size:.9rem; }
.contract-audit-row { display:grid; grid-template-columns:minmax(120px,.8fr) 92px minmax(0,1.5fr); gap:.6rem; align-items:center; padding:.55rem .65rem; border-radius:12px; background:rgba(255,255,255,.035); border:1px solid rgba(255,255,255,.06); }
.contract-audit-row b { color:#e2e8f0; font-size:.78rem; }
.contract-audit-row span { color:rgba(226,232,240,.46); font-size:.7rem; }
.contract-audit-row em { color:#93c5fd; font-style:normal; font-size:.75rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
@media (max-width: 1300px) { .contract-summary { grid-template-columns:repeat(3,1fr); } .contract-kpi-analysis { grid-template-columns:1fr; } .contract-row-card { grid-template-columns:1fr 1fr 1fr; } .contract-row-main,.contract-progress { grid-column:1 / -1; } .contract-single-stats { grid-template-columns:repeat(2,1fr); } .contract-node { grid-template-columns:1fr 1fr; } }
@media (max-width: 760px) { .contract-controls { grid-template-columns:1fr; } .contract-summary { grid-template-columns:repeat(2,1fr); } .contract-kpi-analysis { grid-column:1 / -1; } .contract-toolbar,.contract-single-head { flex-direction:column; } .contract-audit-row { grid-template-columns:1fr; } }

/* Compact header for modules that only need right-side actions */
.main-header.compact-actions-header {
    margin-bottom: 1rem !important;
    padding-bottom: 1rem !important;
}
.main-header.compact-actions-header .date-selector-container {
    margin-left: auto;
}

/* Contract deep editor sheet */
.contract-editor-scrim { position:fixed; inset:0; background:rgba(0,0,0,.42); backdrop-filter:blur(8px); z-index:120; opacity:0; pointer-events:none; transition:.2s; }
.contract-editor-scrim.show { opacity:1; pointer-events:auto; }
.contract-editor-sheet { position:fixed; left:50%; bottom:0; transform:translate(-50%,105%); width:min(780px, calc(100vw - 24px)); max-height:88vh; overflow:auto; background:#111827; border:1px solid rgba(255,255,255,.14); border-radius:28px 28px 0 0; z-index:130; box-shadow:0 -24px 80px rgba(0,0,0,.45); transition:.28s cubic-bezier(.22,1,.36,1); padding:14px 18px 18px; }
.contract-editor-sheet.show { transform:translate(-50%,0); }
.contract-editor-grab { width:44px; height:5px; border-radius:999px; background:rgba(255,255,255,.22); margin:0 auto 16px; }
.contract-editor-title { display:flex; justify-content:space-between; align-items:flex-start; gap:1rem; margin-bottom:14px; }
.contract-editor-title h2 { margin:0; font-size:1.35rem; color:#f8fafc; font-weight:900; }
.contract-editor-title p { margin:.25rem 0 0; color:rgba(226,232,240,.55); font-size:.82rem; }
.contract-editor-title button { width:36px; height:36px; border:0; border-radius:50%; background:rgba(255,255,255,.10); color:#cbd5e1; font-size:1.35rem; cursor:pointer; }
.contract-editor-form { display:grid; grid-template-columns:1fr 1fr; gap:.8rem; }
.contract-editor-section { grid-column:1 / -1; border:1px solid rgba(148,163,184,.18); background:rgba(15,23,42,.48); border-radius:18px; padding:.85rem; }
.contract-editor-section-head { display:flex; align-items:flex-start; justify-content:space-between; gap:.8rem; margin-bottom:.75rem; }
.contract-editor-section-head b { color:#f8fafc; font-size:.88rem; font-weight:900; }
.contract-editor-section-head span { color:rgba(226,232,240,.48); font-size:.72rem; line-height:1.35; text-align:right; max-width:320px; }
.contract-editor-section-grid,
.contract-template-grid { display:grid; grid-template-columns:1fr 1fr; gap:.8rem; }
.contract-template-panel { background:linear-gradient(135deg, rgba(56,189,248,.10), rgba(251,191,36,.08)); border-color:rgba(96,165,250,.25); }
.contract-editor-field { display:grid; gap:.38rem; }
.contract-editor-field.full { grid-column:1 / -1; }
.contract-editor-field span { color:rgba(226,232,240,.68); font-size:.78rem; font-weight:800; }
.contract-editor-field input, .contract-editor-field select, .contract-editor-field textarea { width:100%; min-height:46px; border:1px solid rgba(255,255,255,.12); background:rgba(15,23,42,.78); color:#f8fafc; border-radius:13px; padding:.55rem .7rem; outline:none; font-size:.88rem; }
.contract-editor-field textarea { min-height:92px; resize:vertical; }
.contract-editor-field input:focus, .contract-editor-field select:focus, .contract-editor-field textarea:focus { border-color:rgba(96,165,250,.65); box-shadow:0 0 0 3px rgba(96,165,250,.14); }
.contract-editor-field input[readonly] { background:rgba(255,255,255,.06); color:rgba(226,232,240,.55); cursor:not-allowed; }
.contract-editor-actions { position:sticky; bottom:-18px; display:flex; gap:.7rem; padding-top:1rem; margin-top:.8rem; background:linear-gradient(to top,#111827 72%,rgba(17,24,39,0)); }
.contract-editor-actions .btn { flex:1; }
@media (max-width: 680px) {
    .contract-editor-form,
    .contract-editor-section-grid,
    .contract-template-grid { grid-template-columns:1fr; }
    .contract-editor-section-head { flex-direction:column; }
    .contract-editor-section-head span { text-align:left; }
}

/* Contract todo workbench */
.contract-seg { grid-template-columns: repeat(3, 1fr); }
.contract-row-main strong { display:block; margin-top:.38rem; color:#38bdf8; font-size:.76rem; font-weight:900; }
.contract-todo-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; }
.contract-todo-group { border:1px solid rgba(255,255,255,.10); border-radius:18px; padding:1rem; background:rgba(255,255,255,.035); }
.contract-todo-head { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; margin-bottom:.85rem; }
.contract-todo-head h3 { margin:0; color:#f8fafc; font-size:.98rem; font-weight:900; }
.contract-todo-head p { margin:.28rem 0 0; color:rgba(226,232,240,.50); font-size:.72rem; }
.contract-todo-head b { color:#fbbf24; font-size:1.1rem; font-variant-numeric:tabular-nums; }
.contract-todo-list { display:flex; flex-direction:column; gap:.65rem; }
.contract-todo-list .contract-row-card { grid-template-columns:minmax(220px,1fr) repeat(2,minmax(80px,.5fr)) auto; padding:.85rem; }
.contract-todo-list .contract-row-card > div:nth-of-type(4),
.contract-todo-list .contract-row-card > div:nth-of-type(5) { display:none; }
.contract-todo-list .contract-row-main,
.contract-todo-list .contract-progress { grid-column:1 / -1; }
@media (max-width: 1300px) { .contract-todo-grid { grid-template-columns:1fr; } }
@media (max-width: 760px) { .contract-seg { grid-template-columns:1fr; border-radius:16px; } }
.contract-controls .contract-seg { display:grid !important; grid-template-columns:repeat(3, minmax(0,1fr)) !important; max-width:none; }

/* Contract todo simplified business groups */
.contract-todo-grid.contract-todo-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.contract-todo-grid-3 .contract-todo-list .contract-row-card { grid-template-columns: minmax(0,1fr); }
.contract-todo-grid-3 .contract-todo-list .contract-row-card > div:not(.contract-row-main),
.contract-todo-grid-3 .contract-todo-list .contract-row-card > em { display:none; }
.contract-todo-grid-3 .contract-todo-list .contract-progress { grid-column:1 / -1; }
@media (max-width: 1500px) { .contract-todo-grid.contract-todo-grid-3 { grid-template-columns: 1fr; } }

/* Contract workbench v2: two active columns + paused at bottom */
.contract-todo-grid.contract-todo-grid-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.contract-todo-grid-compact .contract-todo-group.paused { grid-column: 1 / -1; }
.contract-todo-grid-compact .contract-todo-group.paused .contract-todo-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
.contract-row-card .next-action { color:#38bdf8 !important; }
.contract-row-main strong { color:#38bdf8 !important; }
.contract-todo-grid-compact .contract-row-card { grid-template-columns:minmax(0,1.4fr) repeat(3,minmax(86px,.55fr)) auto; }
.contract-todo-grid-compact .contract-row-card > div:nth-of-type(5) { display:none; }
@media (max-width: 1500px) {
    .contract-todo-grid.contract-todo-grid-compact { grid-template-columns: 1fr; }
    .contract-todo-grid-compact .contract-todo-group.paused .contract-todo-list { grid-template-columns:1fr; }
}

/* Contract workbench layout: receivable + secondary stack */
.contract-todo-grid.contract-todo-grid-compact {
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, .85fr) !important;
    grid-template-areas:
        "main my"
        "main paused";
    align-items: start;
}
.contract-todo-grid-compact .contract-todo-group:nth-child(1) { grid-area: main; }
.contract-todo-grid-compact .contract-todo-group:nth-child(2) { grid-area: my; }
.contract-todo-grid-compact .contract-todo-group.paused { grid-area: paused; grid-column: auto !important; }
.contract-todo-grid-compact .contract-todo-group.paused .contract-todo-list { display:flex !important; flex-direction:column; }
@media (max-width: 1300px) {
    .contract-todo-grid.contract-todo-grid-compact {
        grid-template-columns: 1fr !important;
        grid-template-areas: "main" "my" "paused";
    }
}

/* Contract workbench fixed-height columns with internal scroll */
.contract-todo-grid.contract-todo-grid-compact {
    height: 760px;
    min-height: 760px;
    grid-template-rows: 1fr 1fr;
}
.contract-todo-grid-compact .contract-todo-group {
    min-height: 0;
    max-height: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.contract-todo-grid-compact .contract-todo-group:nth-child(1) {
    height: 760px;
}
.contract-todo-grid-compact .contract-todo-group:nth-child(2),
.contract-todo-grid-compact .contract-todo-group.paused {
    height: 372px;
}
.contract-todo-grid-compact .contract-todo-head {
    flex: 0 0 auto;
}
.contract-todo-grid-compact .contract-todo-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: .25rem;
}
.contract-todo-grid-compact .contract-todo-list::-webkit-scrollbar { width: 6px; }
.contract-todo-grid-compact .contract-todo-list::-webkit-scrollbar-thumb { background: rgba(148,163,184,.35); border-radius: 999px; }
@media (max-width: 1300px) {
    .contract-todo-grid.contract-todo-grid-compact {
        height: auto;
        min-height: 0;
        grid-template-rows: auto;
    }
    .contract-todo-grid-compact .contract-todo-group:nth-child(1),
    .contract-todo-grid-compact .contract-todo-group:nth-child(2),
    .contract-todo-grid-compact .contract-todo-group.paused {
        height: 520px;
    }
}

/* Contract todo content restore: fixed height only, do not hide card fields */
.contract-todo-grid-compact .contract-todo-list .contract-row-card {
    grid-template-columns: minmax(260px,1.5fr) repeat(4,minmax(90px,.6fr)) auto !important;
}
.contract-todo-grid-compact .contract-todo-list .contract-row-card > div,
.contract-todo-grid-compact .contract-todo-list .contract-row-card > em {
    display: block !important;
}
.contract-todo-grid-compact .contract-todo-list .contract-row-main,
.contract-todo-grid-compact .contract-todo-list .contract-progress {
    grid-column: 1 / -1 !important;
}
@media (max-width: 1500px) {
    .contract-todo-grid-compact .contract-todo-list .contract-row-card {
        grid-template-columns: minmax(220px,1fr) repeat(2,minmax(90px,.55fr)) auto !important;
    }
}

/* Contract card full information: keep original finance fields plus next action line */
.contract-row-card,
.contract-todo-grid-compact .contract-todo-list .contract-row-card {
    grid-template-columns: minmax(280px,1.5fr) repeat(5,minmax(88px,.58fr)) auto !important;
}
.contract-row-card > div,
.contract-row-card > em,
.contract-todo-grid-compact .contract-todo-list .contract-row-card > div,
.contract-todo-grid-compact .contract-todo-list .contract-row-card > em {
    display: block !important;
}
.contract-row-card .contract-row-main,
.contract-row-card .contract-progress,
.contract-todo-grid-compact .contract-todo-list .contract-row-main,
.contract-todo-grid-compact .contract-todo-list .contract-progress {
    grid-column: 1 / -1 !important;
}
@media (max-width: 1500px) {
    .contract-row-card,
    .contract-todo-grid-compact .contract-todo-list .contract-row-card {
        grid-template-columns: minmax(240px,1fr) repeat(3,minmax(88px,.55fr)) auto !important;
    }
}

/* Contract card original information layout restore */
.contract-row-card,
.contract-todo-grid-compact .contract-todo-list .contract-row-card {
    grid-template-columns: minmax(260px,1.25fr) repeat(5,minmax(92px,.62fr)) auto !important;
    align-items: center !important;
}
.contract-row-card .contract-row-main,
.contract-todo-grid-compact .contract-todo-list .contract-row-main {
    grid-column: auto !important;
}
.contract-row-main strong { display: none !important; }
.contract-row-card .contract-progress,
.contract-todo-grid-compact .contract-todo-list .contract-progress {
    grid-column: 1 / -1 !important;
    height: auto !important;
    background: transparent !important;
    overflow: visible !important;
}
.contract-progress label {
    display: flex;
    justify-content: space-between;
    color: rgba(226,232,240,.58);
    font-size: .7rem;
    font-weight: 800;
    margin-bottom: .42rem;
}
.contract-progress > div {
    height: 9px;
    background: rgba(255,255,255,.08);
    border-radius: 999px;
    overflow: hidden;
}
.contract-progress > div > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg,#38bdf8,#34d399);
    border-radius: 999px;
}
@media (max-width: 1500px) {
    .contract-row-card,
    .contract-todo-grid-compact .contract-todo-list .contract-row-card {
        grid-template-columns: 1fr 1fr 1fr !important;
    }
    .contract-row-card .contract-row-main,
    .contract-todo-grid-compact .contract-todo-list .contract-row-main,
    .contract-row-card .contract-progress,
    .contract-todo-grid-compact .contract-todo-list .contract-progress {
        grid-column: 1 / -1 !important;
    }
}

/* Contract todo height fix: card must be fully readable before list scrolls */
.contract-todo-grid.contract-todo-grid-compact {
    height: 920px !important;
    min-height: 920px !important;
    grid-template-rows: 1fr 1fr !important;
}
.contract-todo-grid-compact .contract-todo-group:nth-child(1) {
    height: 920px !important;
}
.contract-todo-grid-compact .contract-todo-group:nth-child(2),
.contract-todo-grid-compact .contract-todo-group.paused {
    height: 452px !important;
}
.contract-todo-grid-compact .contract-todo-list .contract-row-card {
    min-height: 156px !important;
    height: auto !important;
    overflow: visible !important;
    padding: 1rem !important;
    row-gap: .7rem !important;
}
.contract-todo-grid-compact .contract-todo-list .contract-row-main b {
    line-height: 1.25 !important;
}
.contract-todo-grid-compact .contract-todo-list .contract-row-main span {
    line-height: 1.35 !important;
}
.contract-todo-grid-compact .contract-todo-list .contract-progress {
    margin-top: .15rem !important;
}
@media (max-width: 1300px) {
    .contract-todo-grid.contract-todo-grid-compact {
        height: auto !important;
        min-height: 0 !important;
    }
    .contract-todo-grid-compact .contract-todo-group:nth-child(1),
    .contract-todo-grid-compact .contract-todo-group:nth-child(2),
    .contract-todo-grid-compact .contract-todo-group.paused {
        height: 680px !important;
    }
}

/* Contract card compact inline progress */
.contract-row-main .contract-inline-progress {
    margin-top: .5rem;
    height: 7px;
    width: 100%;
    background: rgba(255,255,255,.08);
    border-radius: 999px;
    overflow: hidden;
}
.contract-row-main .contract-inline-progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg,#38bdf8,#34d399);
    border-radius: 999px;
}
.contract-todo-grid-compact .contract-todo-list .contract-row-card {
    min-height: 126px !important;
    row-gap: .55rem !important;
}

/* contract label clean: move status badge to top right, avoid blocking */
.contract-row-card em {
    position: absolute;
    top: .85rem;
    right: .85rem;
    z-index: 2;
    white-space: nowrap !important;
    pointer-events: none;
}
.contract-row-card.done em { background: rgba(148,163,184,.14) !important; color: #cbd5e1 !important; }
.contract-row-main {
    padding-right: 92px !important;
}
/* mobile stack: single column with visible key info */
@media (max-width: 800px) {
    .contract-row-card {
        grid-template-columns: 1fr 1fr !important;
        row-gap: .5rem !important;
        padding-right: 2.8rem !important;
    }
    .contract-row-card .contract-row-main,
    .contract-row-card .contract-progress { grid-column: 1 / -1 !important; }
    .contract-row-card em { top: .75rem; right: .65rem; font-size: .65rem !important; padding: .25rem .48rem !important; }
    .contract-row-main { padding-right: 84px !important; }
}

/* mobile contract card deduplication */
@media (max-width: 800px) {
    .contract-row-card {
        grid-template-columns: 1fr 1fr !important;
        row-gap: .45rem !important;
        column-gap: .5rem !important;
        padding: .9rem .75rem !important;
        min-height: auto !important;
    }
    .contract-row-card .contract-row-main { grid-column: 1 / -1 !important; margin-bottom: .3rem; }
    .contract-row-main { padding-right: 0 !important; }
    .contract-row-card em {
        position: static !important;
        display: inline-flex !important;
        margin-top: .35rem !important;
        font-size: .62rem !important;
        padding: .25rem .5rem !important;
        white-space: nowrap !important;
    }
    .contract-row-card > div { grid-column: auto !important; }
}

/* final mobile contract card single clean layout */
@media (max-width: 800px) {
    .contract-row-card {
        grid-template-columns: 1fr 1fr !important;
        row-gap: .55rem !important;
        column-gap: .6rem !important;
        padding: .85rem !important;
        min-height: auto !important;
        align-items: start !important;
        position: relative !important;
        overflow: visible !important;
    }
    .contract-row-card .contract-row-main {
        grid-column: 1 / -1 !important;
        margin-bottom: .25rem !important;
    }
    .contract-row-main {
        padding-right: 0 !important;
        min-width: 0 !important;
    }
    .contract-row-card em {
        position: static !important;
        display: inline-block !important;
        margin-top: .3rem !important;
        font-size: .6rem !important;
        padding: .22rem .42rem !important;
        white-space: nowrap !important;
        pointer-events: auto !important;
    }
    .contract-row-card > div:not(.contract-row-main) {
        grid-column: auto !important;
        min-width: 0 !important;
    }
    .contract-row-card .contract-progress { display: none !important; }
    .contract-todo-grid.contract-todo-grid-compact { grid-template-columns: 1fr !important; }
    .contract-todo-grid-compact .contract-todo-list .contract-row-card { min-height: auto !important; }
}

/* Deep cost monthly report */
.deep-cost-shell {
    height: calc(100vh - 118px);
    overflow: auto;
    padding-right: .25rem;
}

.deep-cost-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    margin-bottom: 1rem;
    border-radius: 8px;
}

.deep-cost-toolbar h2 {
    font-size: 1.05rem;
    margin: 0 0 .2rem;
}

.deep-cost-toolbar p {
    margin: 0;
    color: var(--text-secondary);
    font-size: .82rem;
}

.deep-cost-actions {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.deep-cost-actions #deep-cost-month-chips {
    width: auto;
    margin: 0;
    gap: .45rem;
}

.deep-cost-actions .analysis-month-chip {
    min-height: 34px;
    padding: .35rem .82rem;
    font-size: .78rem;
}

.deep-cost-status {
    display: none;
    padding: .9rem 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    color: var(--text-secondary);
}

.deep-cost-status.show {
    display: block;
}

.deep-cost-report {
    display: grid;
    gap: 1rem;
    padding-bottom: 2rem;
}

.deep-core-board {
    padding: .8rem .9rem .85rem;
    margin-bottom: .8rem;
    border: 1px solid rgba(148,163,184,.16);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(2,6,23,.34), rgba(15,23,42,.18));
}

.deep-core-board h2 {
    margin: 0 0 .6rem;
    color: #fbbf24;
    font-size: 1rem;
    line-height: 1.2;
    font-weight: 900;
    letter-spacing: .02em;
}

.deep-core-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(430px, 1fr));
    gap: .5rem;
}

.deep-core-line {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: .55rem;
    align-items: stretch;
    padding: .5rem .7rem .55rem .55rem;
    border-left: 4px solid rgba(148,163,184,.5);
    border-radius: 7px;
    background: rgba(255,255,255,.035);
}

.deep-core-line.good {
    border-left-color: #10b981;
    background: linear-gradient(90deg, rgba(16,185,129,.13), rgba(255,255,255,.025));
}

.deep-core-line.warn {
    border-left-color: #fbbf24;
    background: linear-gradient(90deg, rgba(251,191,36,.12), rgba(255,255,255,.025));
}

.deep-core-line.bad {
    border-left-color: #ef4444;
    background: linear-gradient(90deg, rgba(239,68,68,.13), rgba(255,255,255,.025));
}

.deep-core-index {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    background: rgba(255,255,255,.08);
    color: #f8fafc;
    font-size: .78rem;
    font-weight: 900;
}

.deep-core-copy {
    min-width: 0;
}

.deep-core-copy span {
    display: block;
    margin-bottom: .12rem;
    color: #94a3b8;
    font-size: .72rem;
    font-weight: 800;
}

.deep-core-copy p {
    margin: 0;
    color: #e5e7eb;
    font-size: .86rem;
    line-height: 1.4;
    font-weight: 700;
}

.deep-core-copy em {
    display: block;
    margin-top: .15rem;
    color: #cbd5e1;
    font-size: .78rem;
    line-height: 1.4;
    font-style: normal;
    font-weight: 600;
}

.deep-core-copy mark {
    padding: 0 .08em;
    border-radius: 3px;
    background: rgba(251,191,36,.16);
    color: #fef3c7;
    font-weight: 950;
}

.deep-hero {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .4rem 1rem;
    padding: .75rem 1.1rem;
    border-radius: 10px;
    margin-bottom: .7rem;
    background: linear-gradient(135deg, rgba(239,68,68,.12), rgba(251,191,36,.05));
    border: 1px solid rgba(239,68,68,.28);
}
.deep-hero--good {
    background: linear-gradient(135deg, rgba(16,185,129,.12), rgba(56,189,248,.06));
    border-color: rgba(16,185,129,.28);
}
.deep-hero-label { color: #94a3b8; font-size: .78rem; font-weight: 800; margin-right: .2rem; }
.deep-hero-number { font-size: 2rem; font-weight: 900; letter-spacing: -1px; line-height: 1.1; }
.deep-hero-number--good { color: #10b981; }
.deep-hero-number--bad { color: #ef4444; }
.deep-hero-change { font-size: .9rem; color: #cbd5e1; font-weight: 700; }
.deep-hero-change b { color: #f8fafc; font-weight: 900; }
.deep-hero-verdict { flex-basis: 100%; color: #fbbf24; font-size: .95rem; font-weight: 800; line-height: 1.3; }

.deep-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .55rem;
    margin-bottom: .7rem;
}
.deep-kpi {
    padding: .6rem .8rem .65rem;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(148,163,184,.14);
    border-radius: 8px;
    border-left: 3px solid rgba(148,163,184,.5);
}
.deep-kpi--good { border-left-color: #10b981; }
.deep-kpi--warn { border-left-color: #fbbf24; }
.deep-kpi--bad { border-left-color: #ef4444; }
.deep-kpi-title { color: #94a3b8; font-size: .74rem; font-weight: 800; }
.deep-kpi-value { font-size: 1.25rem; font-weight: 900; margin-top: .15rem; color: #f8fafc; }
.deep-kpi--good .deep-kpi-value { color: #10b981; }
.deep-kpi--warn .deep-kpi-value { color: #fbbf24; }
.deep-kpi--bad .deep-kpi-value { color: #ef4444; }
.deep-kpi-text { margin-top: .2rem; font-size: .74rem; color: #cbd5e1; line-height: 1.35; }

.deep-flags {
    padding: .6rem 1rem .65rem;
    background: rgba(239,68,68,.07);
    border: 1px solid rgba(239,68,68,.22);
    border-radius: 8px;
    margin-bottom: .8rem;
}
.deep-flags-title { color: #fbbf24; font-size: .85rem; font-weight: 900; margin-bottom: .3rem; }
.deep-flags ul { margin: 0; padding-left: 1.15rem; }
.deep-flags li { color: #e5e7eb; line-height: 1.55; font-size: .84rem; }

/* ===== 老板决策驾驶舱 ===== */
.boss-cockpit { display: flex; flex-direction: column; gap: .8rem; }

/* 状态条 */
.boss-status {
    padding: 1.1rem 1.4rem;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(239,68,68,.16), rgba(15,23,42,.2));
    border: 1px solid rgba(239,68,68,.3);
}
.boss-status.is-profit { background: linear-gradient(135deg, rgba(16,185,129,.16), rgba(15,23,42,.2)); border-color: rgba(16,185,129,.3); }
.boss-status-top { display: flex; align-items: baseline; flex-wrap: wrap; gap: .3rem .9rem; }
.boss-status-month { color: #94a3b8; font-size: .85rem; font-weight: 800; }
.boss-status-num { font-size: 2.9rem; font-weight: 900; letter-spacing: -1.5px; line-height: 1; color: #ef4444; }
.boss-status.is-profit .boss-status-num { color: #10b981; }
.boss-status-delta { font-size: 1rem; font-weight: 800; color: #10b981; }
.boss-status-delta.down { color: #ef4444; }
.boss-progress { margin-top: .85rem; }
.boss-progress-track { height: 8px; border-radius: 6px; background: rgba(255,255,255,.08); overflow: hidden; }
.boss-progress-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #10b981, #34d399); }
.boss-progress-label { margin-top: .35rem; font-size: .8rem; color: #cbd5e1; font-weight: 700; }

/* 一句话诊断 */
.boss-diagnosis {
    padding: .8rem 1.1rem;
    border-radius: 10px;
    background: rgba(56,189,248,.08);
    border-left: 3px solid #38bdf8;
    color: #e5e7eb; font-size: .95rem; line-height: 1.55; font-weight: 700;
}
.boss-diagnosis b { color: #fbbf24; font-weight: 900; }

/* 盈亏分析月份切换 loading 态：淡化 + 禁用点击，避免"点了没反应"的错觉 */
#tab-profit-analysis.is-loading {
    position: relative;
    pointer-events: none;
}
#tab-profit-analysis.is-loading > *:not(.analysis-month-chip-wrap):not(.month-chip-row) {
    opacity: .55;
    filter: blur(.3px);
    transition: opacity .12s ease;
}
#tab-profit-analysis.is-loading::after {
    content: "加载中...";
    position: absolute;
    top: 60px; left: 50%; transform: translateX(-50%);
    background: rgba(15,23,42,.85); color: #fbbf24;
    padding: 6px 18px; border-radius: 999px; font-size: .82rem; font-weight: 800;
    pointer-events: none; z-index: 99;
}

/* 保本目标条 */
.boss-target {
    padding: .75rem 1.1rem .8rem;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(251,191,36,.12), rgba(15,23,42,.15));
    border: 1px solid rgba(251,191,36,.3);
}
.boss-target.good { background: linear-gradient(135deg, rgba(16,185,129,.14), rgba(15,23,42,.15)); border-color: rgba(16,185,129,.3); }
.boss-target.bad  { background: linear-gradient(135deg, rgba(239,68,68,.14),  rgba(15,23,42,.15)); border-color: rgba(239,68,68,.3); }
.boss-target-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: .3rem .8rem; }
.boss-target-label { font-size: .82rem; color: #cbd5e1; font-weight: 800; }
.boss-target-num { font-size: 1.8rem; font-weight: 900; color: #fbbf24; letter-spacing: -.5px; line-height: 1; }
.boss-target.good .boss-target-num { color: #10b981; }
.boss-target.bad  .boss-target-num { color: #ef4444; }
.boss-target-formula { font-size: .72rem; color: #64748b; font-weight: 700; }
.boss-target-sub { margin-top: .35rem; font-size: .82rem; color: #cbd5e1; font-weight: 700; }
.boss-target-sub b { color: #fbbf24; font-weight: 900; }
.boss-target.good .boss-target-sub b { color: #10b981; }
.boss-target.bad  .boss-target-sub b { color: #ef4444; }

/* 钱进出双栏 */
.boss-flow { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.boss-flow-col {
    padding: .95rem 1.1rem 1.05rem;
    border-radius: 12px;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(148,163,184,.14);
}
.boss-flow-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: .7rem; }
.boss-flow-head .lbl { font-size: .82rem; font-weight: 800; color: #94a3b8; }
.boss-flow-head .amt { font-size: 1.35rem; font-weight: 900; color: #f8fafc; }
.boss-flow-row { display: grid; grid-template-columns: 3.2rem 1fr 4.6rem; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.boss-flow-row:last-child { margin-bottom: 0; }
.boss-flow-name { font-size: .8rem; color: #cbd5e1; font-weight: 700; }
.boss-flow-bar { height: 14px; border-radius: 5px; background: rgba(255,255,255,.06); overflow: hidden; }
.boss-flow-bar > span { display: block; height: 100%; border-radius: 5px; }
.boss-flow-val { font-size: .78rem; color: #94a3b8; text-align: right; font-weight: 700; }
.boss-flow-val b { color: #e5e7eb; }

/* 决策螺丝清单 */
.boss-levers-title { font-size: .95rem; font-weight: 900; color: #fbbf24; margin: .3rem 0 -.1rem; }
.boss-lever {
    display: grid; grid-template-columns: 12px 1fr; gap: .7rem; align-items: start;
    padding: .7rem .9rem .75rem;
    border-radius: 10px;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(148,163,184,.12);
}
.boss-lever-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: .35rem; background: #94a3b8; }
.boss-lever.good .boss-lever-dot { background: #10b981; box-shadow: 0 0 8px rgba(16,185,129,.6); }
.boss-lever.warn .boss-lever-dot { background: #fbbf24; box-shadow: 0 0 8px rgba(251,191,36,.6); }
.boss-lever.bad .boss-lever-dot { background: #ef4444; box-shadow: 0 0 8px rgba(239,68,68,.6); }
.boss-lever-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: .2rem .6rem; }
.boss-lever-name { font-size: .82rem; color: #94a3b8; font-weight: 800; }
.boss-lever-metric { font-size: 1.05rem; font-weight: 900; color: #f8fafc; }
.boss-lever.good .boss-lever-metric { color: #10b981; }
.boss-lever.warn .boss-lever-metric { color: #fbbf24; }
.boss-lever.bad .boss-lever-metric { color: #ef4444; }
.boss-lever-bench { font-size: .72rem; font-weight: 700; color: #94a3b8; background: rgba(148,163,184,.14); border-radius: 5px; padding: .05rem .4rem; }
.boss-lever-action { margin-top: .25rem; font-size: .82rem; color: #cbd5e1; line-height: 1.45; font-weight: 600; }
.boss-lever-action:before { content: "→ "; color: #64748b; }

/* 时段 */
.boss-periods { display: flex; flex-wrap: wrap; gap: .5rem; }
.boss-period {
    flex: 1 1 auto; min-width: 120px;
    padding: .55rem .8rem; border-radius: 9px;
    background: rgba(255,255,255,.04); border: 1px solid rgba(148,163,184,.12);
}
.boss-period-name { font-size: .78rem; color: #94a3b8; font-weight: 800; }
.boss-period-rate { font-size: 1.1rem; font-weight: 900; color: #f8fafc; margin: .1rem 0; }
.boss-period-sub { font-size: .72rem; color: #64748b; font-weight: 700; }

/* 折叠明细 */
.boss-details { margin-top: .3rem; border-top: 1px solid rgba(148,163,184,.14); padding-top: .3rem; }
.boss-details > summary {
    cursor: pointer; list-style: none; padding: .6rem .2rem;
    font-size: .88rem; font-weight: 800; color: #94a3b8;
    display: flex; align-items: center; gap: .4rem;
}
.boss-details > summary::-webkit-details-marker { display: none; }
.boss-details > summary:before { content: "▸"; transition: transform .2s; }
.boss-details[open] > summary:before { transform: rotate(90deg); }
.boss-details > summary:hover { color: #e5e7eb; }

.boss-section-label { font-size: .95rem; font-weight: 900; color: #fbbf24; margin: .2rem 0 .1rem; }

@media (max-width: 760px) {
    .boss-flow { grid-template-columns: 1fr; }
    .boss-status-num { font-size: 2.3rem; }
}
@media (max-width: 640px) {
    .boss-status { padding: .85rem 1rem; }
    .boss-status-top { gap: .2rem .6rem; }
    .boss-status-num { font-size: 1.9rem; }
    .boss-status-delta { font-size: .82rem; }
    .boss-flow-col { padding: .75rem .85rem; }
    .boss-flow-head .amt { font-size: 1.15rem; }
    .boss-flow-row { grid-template-columns: 2.6rem 1fr 3.4rem; gap: .35rem; }
    .boss-flow-name, .boss-flow-val { font-size: .72rem; }
    .boss-diagnosis { font-size: .86rem; padding: .7rem .9rem; }
    .boss-lever-metric { font-size: .98rem; }
    .boss-period { min-width: calc(50% - .3rem); flex: 1 1 calc(50% - .3rem); }
    .deep-chart { height: 260px !important; }
}

.deep-section-board {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(15,23,42,.72);
    overflow: hidden;
}

.deep-section-card {
    display: grid;
    grid-template-columns: 34px minmax(180px, .9fr) minmax(150px, .65fr) minmax(0, 1.2fr) minmax(0, 1fr);
    gap: .85rem;
    min-height: 0;
    padding: .78rem .95rem;
    border-radius: 0;
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
    align-items: start;
}

.deep-section-card:last-child {
    border-bottom: 0;
}

.deep-section-no {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(255,255,255,.08);
    color: #e5e7eb;
    font-size: .86rem;
    font-weight: 900;
}

.deep-section-body {
    display: contents;
    min-width: 0;
}

.deep-section-body h3 {
    margin: 0;
    color: #e5e7eb;
    font-size: .84rem;
    line-height: 1.4;
}

.deep-section-body b {
    display: block;
    color: #f8fafc;
    font-size: .98rem;
    line-height: 1.35;
}

.deep-section-body p {
    margin: 0;
    color: #cbd5e1;
    font-size: .8rem;
    line-height: 1.45;
}

.deep-section-body em {
    display: block;
    margin: 0;
    padding: 0;
    border-top: 0;
    color: #e5e7eb;
    font-size: .8rem;
    line-height: 1.45;
    font-style: normal;
    font-weight: 650;
}

.deep-boss-panel {
    display: grid;
    grid-template-columns: minmax(320px, .9fr) minmax(520px, 1.35fr);
    gap: 1rem;
    padding: 1.15rem;
    border-radius: 8px;
    border: 1px solid rgba(16,185,129,.24);
    background: linear-gradient(135deg, rgba(6,78,59,.72), rgba(15,23,42,.94) 56%, rgba(24,24,27,.92));
}

.deep-boss-main {
    display: flex;
    flex-direction: column;
    min-height: 250px;
}

.deep-boss-main > span {
    width: fit-content;
    padding: .28rem .55rem;
    border-radius: 6px;
    background: rgba(16,185,129,.14);
    color: #86efac;
    font-size: .72rem;
    font-weight: 800;
}

.deep-boss-main h2 {
    margin: .9rem 0 .65rem;
    font-size: 1.75rem;
    line-height: 1.25;
}

.deep-boss-main p {
    margin: 0;
    color: #d1d5db;
    font-size: 1rem;
    line-height: 1.65;
    font-weight: 650;
}

.deep-root-cause {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem;
    margin-top: auto;
    padding-top: 1rem;
}

.deep-root-cause b,
.deep-root-cause em {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: .32rem .55rem;
    border-radius: 6px;
    font-size: .8rem;
    font-style: normal;
    background: rgba(255,255,255,.08);
}

.deep-root-cause b {
    color: #fef3c7;
    background: rgba(245,158,11,.18);
}

.deep-boss-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.deep-boss-card {
    min-height: 126px;
    padding: .9rem;
    border-radius: 8px;
    background: rgba(15,23,42,.76);
    border: 1px solid rgba(255,255,255,.09);
    border-left: 4px solid var(--blue-accent);
}

.deep-boss-card.good { border-left-color: var(--green-accent); }
.deep-boss-card.warn { border-left-color: var(--orange-accent); }
.deep-boss-card.bad { border-left-color: var(--red-accent); }

.deep-boss-card span {
    display: block;
    color: var(--text-secondary);
    font-size: .76rem;
    font-weight: 750;
}

.deep-boss-card b {
    display: block;
    margin-top: .35rem;
    font-size: 1.28rem;
    line-height: 1.2;
}

.deep-boss-card p {
    margin: .45rem 0 0;
    color: #cbd5e1;
    font-size: .82rem;
    line-height: 1.55;
}

.deep-watch-list {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: .8fr repeat(3, 1fr);
    gap: .65rem;
    align-items: stretch;
}

.deep-watch-list b,
.deep-watch-list p {
    margin: 0;
    padding: .72rem .8rem;
    border-radius: 8px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
}

.deep-watch-list b {
    display: flex;
    align-items: center;
    color: #fef3c7;
}

.deep-watch-list p {
    color: #d1d5db;
    font-size: .82rem;
    line-height: 1.45;
}

.deep-hero {
    display: grid;
    grid-template-columns: minmax(280px, 1.2fr) minmax(320px, 1fr);
    gap: 1rem;
}

.deep-supporting {
    opacity: .92;
}

.deep-headline {
    padding: 1.15rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.08);
    background: linear-gradient(135deg, rgba(15,23,42,.92), rgba(20,83,45,.28));
}

.deep-headline h2 {
    font-size: 1.25rem;
    margin: 0 0 .9rem;
    line-height: 1.35;
}

.deep-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .65rem;
}

.deep-kpi {
    padding: .85rem;
    border-radius: 8px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.07);
}

.deep-kpi span {
    display: block;
    color: var(--text-secondary);
    font-size: .72rem;
}

.deep-kpi b {
    display: block;
    margin-top: .3rem;
    font-size: 1.05rem;
}

.deep-kpi small {
    display: block;
    margin-top: .2rem;
    color: var(--text-secondary);
    font-size: .68rem;
}

.deep-insights {
    display: grid;
    gap: .65rem;
}

.deep-insight {
    padding: .85rem .95rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.04);
    border-left: 3px solid var(--blue-accent);
}

.deep-insight.good { border-left-color: var(--green-accent); }
.deep-insight.warn { border-left-color: var(--orange-accent); }
.deep-insight.bad { border-left-color: var(--red-accent); }

.deep-insight b {
    display: block;
    margin-bottom: .25rem;
    font-size: .9rem;
}

.deep-insight p {
    margin: 0;
    color: var(--text-secondary);
    font-size: .82rem;
}

.deep-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.deep-card {
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(20, 26, 42, 0.62);
}

.deep-card h3 {
    margin: 0 0 .75rem;
    font-size: .95rem;
}

.deep-chart {
    width: 100%;
    height: 320px;
}

.deep-chart-conclusion {
    margin-top: .75rem;
    padding: .78rem .85rem;
    border-radius: 8px;
    background: rgba(16,185,129,.09);
    border: 1px solid rgba(16,185,129,.18);
    color: #d1fae5;
    font-size: .86rem;
    line-height: 1.55;
    font-weight: 650;
}

.deep-wide {
    grid-column: 1 / -1;
}

.deep-table-wrap {
    overflow: auto;
}

.deep-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
    font-size: .82rem;
}

.deep-table th,
.deep-table td {
    padding: .55rem .65rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    text-align: right;
}

.deep-table th:first-child,
.deep-table td:first-child {
    text-align: left;
}

.deep-table th {
    color: #93c5fd;
    font-weight: 600;
}

.deep-recommendations {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
}

.deep-rec {
    padding: .85rem;
    border-radius: 8px;
    background: rgba(245,158,11,.08);
    border: 1px solid rgba(245,158,11,.18);
    color: #f8fafc;
    font-size: .82rem;
}

.deep-good { color: var(--green-accent); }
.deep-warn { color: var(--orange-accent); }
.deep-bad { color: var(--red-accent); }

@media (max-width: 980px) {
    .deep-core-board {
        padding: .95rem .85rem 1rem;
    }
    .deep-core-line {
        grid-template-columns: 28px 1fr;
        padding: .68rem .72rem;
    }
    .deep-core-copy p {
        font-size: .94rem;
    }
    .deep-section-board {
        grid-template-columns: 1fr;
    }
    .deep-section-card {
        grid-template-columns: 28px 1fr;
        gap: .55rem .7rem;
    }
    .deep-section-body {
        display: block;
    }
    .deep-section-body b,
    .deep-section-body p,
    .deep-section-body em {
        margin-top: .35rem;
    }
    .deep-boss-panel,
    .deep-hero,
    .deep-chart-grid,
    .deep-recommendations {
        grid-template-columns: 1fr;
    }
    .deep-watch-list {
        grid-template-columns: 1fr;
    }
    .deep-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .deep-cost-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }
    .deep-cost-actions {
        width: 100%;
        justify-content: flex-start;
    }
    .deep-cost-actions #deep-cost-month-chips,
    .deep-cost-actions .btn {
        width: 100%;
    }
    .deep-cost-actions #deep-cost-month-chips {
        justify-content: flex-start;
    }
    .deep-chart {
        height: 280px;
    }
}

/* v2.7.5 紧凑版季度汇总 */
.profit-quarter-summary-compact {
    background: rgba(30, 41, 59, 0.25);
    border: 1px solid rgba(251, 191, 36, 0.15);
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    margin-top: 1rem;
}
.profit-quarter-summary-compact .q-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 0.45rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.profit-quarter-summary-compact .q-title small {
    font-weight: normal;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.7rem;
}
.profit-quarter-summary-compact .q-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.45rem;
}
.profit-quarter-summary-compact .q-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 0.35rem 0.45rem;
    font-size: 0.78rem;
    gap: 2px;
}
.profit-quarter-summary-compact .q-label {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.72rem;
}
.profit-quarter-summary-compact .q-val {
    color: #fbbf24;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.8rem;
}
@media (max-width: 768px) {
    .profit-quarter-summary-compact .q-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Dish sales module: aligned with reconciliation center compact glass style */
#tab-dish-sales .dish-sales-shell { display:flex; flex-direction:column; gap:1rem; }
#tab-dish-sales .dish-hero-section { height:auto !important; }
#tab-dish-sales .dish-sales-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:.75rem; }
#tab-dish-sales .dish-sales-toolbar .custom-select { min-width:140px; }
#tab-dish-sales .dish-sales-note { color:var(--text-muted); font-size:.82rem; }
#tab-dish-sales .dish-kpi-grid { grid-template-columns: repeat(6, minmax(0,1fr)); }
#tab-dish-sales .recon-mini-card strong { display:block; font-size:1.25rem; color:#fff; margin:.25rem 0; }
#tab-dish-sales .recon-mini-card span { color:var(--text-muted); font-size:.76rem; }
#tab-dish-sales .dish-sales-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
#tab-dish-sales .dish-sales-grid .recon-section { height:330px !important; }
#tab-dish-sales .dish-rank-row { display:grid; grid-template-columns:28px 1fr auto; align-items:center; gap:.6rem; padding:.55rem .25rem; border-bottom:1px solid rgba(255,255,255,.06); }
#tab-dish-sales .dish-rank-row b { width:22px; height:22px; display:inline-flex; align-items:center; justify-content:center; border-radius:8px; background:rgba(255,255,255,.08); color:#fff; font-size:.72rem; }
#tab-dish-sales .dish-rank-row span { color:#fff; font-weight:700; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#tab-dish-sales .dish-rank-row span em { display:block; color:var(--text-muted); font-size:.72rem; font-style:normal; font-weight:500; margin-top:.15rem; }
#tab-dish-sales .dish-rank-row strong { color:#fff; font-size:.86rem; }
#tab-dish-sales .dish-rank-row.up strong, #tab-dish-sales .pos { color:#2ecc71; }
#tab-dish-sales .dish-rank-row.down strong, #tab-dish-sales .neg { color:#ff6b6b; }
#tab-dish-sales .dish-decision-section { height:auto !important; }
#tab-dish-sales .dish-decision-table { min-width:900px; }
#tab-dish-sales .dish-tag { display:inline-flex; padding:.18rem .48rem; border-radius:999px; font-size:.72rem; font-weight:800; background:rgba(255,255,255,.1); color:#fff; }
#tab-dish-sales .dish-tag.增长, #tab-dish-sales .dish-tag.新品 { background:rgba(46,204,113,.16); color:#2ecc71; }
#tab-dish-sales .dish-tag.下滑, #tab-dish-sales .dish-tag.淘汰候选 { background:rgba(255,107,107,.16); color:#ff6b6b; }
#tab-dish-sales .empty-state { color:var(--text-muted); padding:1rem; text-align:center; }
@media (max-width: 1200px) {
  #tab-dish-sales .dish-kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  #tab-dish-sales .dish-sales-grid { grid-template-columns: 1fr; }
}

#tab-dish-sales .dish-month-chip-row { margin:0; width:auto; }
#tab-dish-sales .recon-section-title small { color:var(--text-muted); font-weight:600; margin-left:auto; }
#tab-dish-sales .dish-month-analysis-section { height:auto !important; }
#tab-dish-sales .dish-analysis-body { display:grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
#tab-dish-sales .dish-chart-card { background:rgba(255,255,255,.035); border:1px solid rgba(255,255,255,.08); border-radius:14px; padding:.75rem; min-height:300px; }
#tab-dish-sales .dish-chart-card:first-child { grid-column:1 / -1; }
#tab-dish-sales .dish-chart-card h4 { margin:0 0 .5rem; color:#fff; font-size:.9rem; }
#tab-dish-sales .dish-chart { height:260px; width:100%; }
@media (max-width: 1100px) { #tab-dish-sales .dish-analysis-body { grid-template-columns:1fr; } #tab-dish-sales .dish-chart-card:first-child { grid-column:auto; } }

#tab-dish-sales .dish-sales-toolbar { justify-content:center; padding:.25rem 0 .75rem; }
#tab-dish-sales .dish-sales-toolbar #btn-dish-sales-upload { margin-left:.5rem; }
#tab-dish-sales .dish-zero-title { align-items:center; gap:.6rem; flex-wrap:wrap; }
#tab-dish-sales .dish-category-chips { display:flex; flex-wrap:wrap; gap:.3rem; margin-left:auto; }
#tab-dish-sales .dish-category-chip { border:1px solid rgba(255,255,255,.12); background:rgba(255,255,255,.04); color:var(--text-secondary); border-radius:999px; padding:.18rem .5rem; font-size:.66rem; font-weight:800; cursor:pointer; }
#tab-dish-sales .dish-category-chip.active { color:#111827; background:#fbbf24; border-color:#fbbf24; }

/* Dish lists are full-page, compact and never internally scroll */
#tab-dish-sales .dish-sales-grid .recon-section { height:auto !important; min-height:0 !important; }
#tab-dish-sales .dish-sales-grid .recon-scroll-list { max-height:none !important; height:auto !important; overflow:visible !important; }
#tab-dish-sales .dish-rank-row { padding:.38rem .2rem; gap:.45rem; }
#tab-dish-sales .dish-rank-row span { font-size:.76rem; }
#tab-dish-sales .dish-rank-row strong { font-size:.75rem; }
#tab-dish-sales .dish-rank-row b { width:19px; height:19px; font-size:.62rem; border-radius:6px; }
#tab-dish-sales .recon-section-title { font-size:.8rem; padding:.6rem .75rem; }
#tab-dish-sales .recon-section-body { padding:.55rem .7rem; }
#tab-dish-sales .dish-top-category-bar { display:flex; align-items:center; gap:.7rem; padding:.55rem .75rem; border:1px solid rgba(255,255,255,.08); border-radius:12px; background:rgba(255,255,255,.025); }
#tab-dish-sales .dish-top-category-bar > span { color:#fff; font-size:.76rem; font-weight:800; }
#tab-dish-sales-trend .dish-signal-list { min-height:240px; }
#tab-dish-sales-trend .dish-signal-row { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:.5rem; padding:.4rem .15rem; border-bottom:1px solid rgba(255,255,255,.06); color:#cbd5e1; font-size:.74rem; }
#tab-dish-sales-trend .dish-signal-row b { font-size:.62rem; padding:.14rem .35rem; border-radius:999px; background:rgba(255,255,255,.08); }
#tab-dish-sales-trend .dish-signal-row.up b,#tab-dish-sales-trend .dish-signal-row.up strong { color:#4ade80; }
#tab-dish-sales-trend .dish-signal-row.down b,#tab-dish-sales-trend .dish-signal-row.down strong { color:#fb7185; }
#tab-dish-sales-trend .dish-zero-group { margin-bottom:.65rem; }
#tab-dish-sales-trend .dish-zero-group h5 { margin:0; padding:.3rem 0; color:#fbbf24; font-size:.72rem; }
#tab-dish-sales-trend .dish-zero-group em { color:#64748b; font-size:.7rem; }

#tab-dish-sales .dish-five-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.8rem; }
#tab-dish-sales .dish-five-grid .recon-section { height:auto !important; min-height:0 !important; }
#tab-dish-sales .dish-five-grid .recon-section:not(.dish-rank-zero) .recon-scroll-list { max-height:none !important; height:auto !important; overflow:visible !important; }
#tab-dish-sales .dish-rank-zero { grid-column:1/-1; }
#tab-dish-sales .dish-rank-best { border-color:rgba(248,113,113,.28); }
#tab-dish-sales .dish-rank-best .recon-section-title { color:#fca5a5; background:rgba(239,68,68,.075); }
#tab-dish-sales .dish-rank-best .dish-rank-row b { color:#fecaca; background:rgba(239,68,68,.16); }
#tab-dish-sales .dish-rank-best .dish-rank-row strong { color:#f87171; }
#tab-dish-sales .dish-rank-worst { border-color:rgba(74,222,128,.24); }
#tab-dish-sales .dish-rank-worst .recon-section-title { color:#86efac; background:rgba(34,197,94,.065); }
#tab-dish-sales .dish-rank-worst .dish-rank-row b { color:#bbf7d0; background:rgba(34,197,94,.14); }
#tab-dish-sales .dish-rank-worst .dish-rank-row strong { color:#4ade80; }
#tab-dish-sales .dish-rank-zero { border-color:rgba(255,255,255,.16); }
#tab-dish-sales .dish-rank-zero .recon-section-title { color:#f8fafc; background:rgba(255,255,255,.04); }
#tab-dish-sales .dish-rank-zero .dish-rank-row { grid-template-columns:28px 1fr 28px; }
#tab-dish-sales .dish-rank-zero .dish-rank-row b,#tab-dish-sales .dish-rank-zero .dish-rank-row strong { color:#fff; background:rgba(255,255,255,.08); }
@media(max-width:900px){#tab-dish-sales .dish-five-grid{grid-template-columns:1fr}.dish-rank-zero{grid-column:auto!important}}

/* One selected category drives five parallel ranking modules */
#tab-dish-sales .dish-five-grid { grid-template-columns:repeat(5,minmax(0,1fr)); align-items:start; gap:.65rem; }
#tab-dish-sales .dish-rank-zero { grid-column:auto; }
#tab-dish-sales .dish-five-grid .recon-section-title { min-height:42px; padding:.55rem .6rem; font-size:.72rem; line-height:1.25; }
#tab-dish-sales .dish-five-grid .recon-section-body { padding:.4rem .5rem; }
#tab-dish-sales .dish-five-grid .dish-rank-row { grid-template-columns:18px minmax(0,1fr) auto; gap:.3rem; padding:.32rem .05rem; }
#tab-dish-sales .dish-five-grid .dish-rank-row b { width:17px; height:17px; font-size:.58rem; }
#tab-dish-sales .dish-five-grid .dish-rank-row span { white-space:normal; overflow:visible; text-overflow:clip; line-height:1.2; font-size:.68rem; }
#tab-dish-sales .dish-five-grid .dish-rank-row strong { font-size:.66rem; white-space:nowrap; }
#tab-dish-sales .dish-rank-zero .dish-rank-row { grid-template-columns:18px minmax(0,1fr) 18px; }
#tab-dish-sales .dish-top-category-bar { justify-content:flex-start; }
#tab-dish-sales .dish-top-category-bar .dish-category-chips { display:grid; grid-template-columns:repeat(9,minmax(72px,1fr)); flex:1; }
#tab-dish-sales .dish-top-category-bar .dish-category-chip { padding:.38rem .6rem; }
@media(max-width:1350px){#tab-dish-sales .dish-five-grid{grid-template-columns:repeat(5,minmax(175px,1fr));overflow-x:auto;padding-bottom:.4rem}}
@media(max-width:900px){#tab-dish-sales .dish-five-grid{grid-template-columns:repeat(5,minmax(170px,1fr))}#tab-dish-sales .dish-rank-zero{grid-column:auto!important}}

#tab-dish-sales .dish-zero-row { grid-template-columns:18px minmax(0,1fr) auto !important; }
#tab-dish-sales .dish-zero-row button { border:1px solid rgba(255,255,255,.15); background:rgba(255,255,255,.05); color:#cbd5e1; border-radius:6px; padding:.12rem .3rem; font-size:.58rem; cursor:pointer; }
#tab-dish-sales .dish-zero-row button:hover { border-color:#fb7185; color:#fb7185; }
.dish-catalog-shell { display:flex; flex-direction:column; gap:.8rem; }
.dish-catalog-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:.55rem; }
.dish-catalog-toolbar .dish-month-chip-row { flex:1 0 100%; margin:0 0 .25rem; }
.dish-catalog-toolbar input[type="search"],.dish-catalog-toolbar select,.dish-catalog-table select,.dish-catalog-table input { background:#121827; color:#e2e8f0; border:1px solid rgba(255,255,255,.12); border-radius:8px; padding:.42rem .55rem; }
.dish-catalog-toolbar input[type="search"] { min-width:240px; }
.dish-catalog-section { height:auto !important; }
.dish-catalog-table { min-width:760px; font-size:.75rem; }
.dish-catalog-table td,.dish-catalog-table th { padding:.48rem .65rem; }
.dish-catalog-table select { min-width:100px; }

.dish-stats-toggle { display:inline-flex; align-items:center; gap:.4rem; cursor:pointer; color:#cbd5e1; font-size:.72rem; }
.dish-stats-toggle input { width:15px; height:15px; accent-color:#fbbf24; }
.dish-stats-toggle:has(input:not(:checked)) span { color:#fb7185; }

#dish-catalog-category-filter-chips { display:flex; flex-wrap:wrap; gap:.35rem; max-width:820px; }
.dish-row-category-chips { display:flex; flex-wrap:wrap; gap:.22rem; max-width:520px; }
.dish-row-category-chips .dish-category-chip { font-size:.6rem; padding:.16rem .34rem; border-radius:999px; }
.dish-catalog-table td:nth-child(2) { min-width:430px; }

/* 菜品管理：仅顶部分类筛选用色块；表格内分类保持下拉 */
#tab-dish-sales-catalog #dish-catalog-category-filter-chips .dish-category-chip {
  background: rgba(255,255,255,.045) !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  border-radius: 999px !important;
  padding: .36rem .72rem !important;
  font-size: .72rem !important;
  font-weight: 800 !important;
}
#tab-dish-sales-catalog #dish-catalog-category-filter-chips .dish-category-chip.active {
  background: #fbbf24 !important;
  border-color: #fbbf24 !important;
  color: #111827 !important;
  box-shadow: 0 0 0 2px rgba(251,191,36,.18) !important;
}
#tab-dish-sales-catalog #dish-catalog-category-filter-chips .dish-category-chip:hover {
  border-color: rgba(251,191,36,.75) !important;
  color: #fff !important;
}
#tab-dish-sales-catalog #dish-catalog-category-filter-chips .dish-category-chip.active:hover { color:#111827 !important; }
#tab-dish-sales-catalog .dish-catalog-table td:nth-child(2) { min-width: 130px; }

.dish-catalog-table .dish-merge-input { min-width:220px; background:#121827; color:#e2e8f0; border:1px solid rgba(255,255,255,.12); border-radius:8px; padding:.42rem .55rem; }
.dish-catalog-table th:nth-child(2), .dish-catalog-table td:nth-child(2) { min-width:240px; }



/* 修正：菜品销售顶部不做悬浮吸顶，避免内容滑到下面露底/穿透 */
.main-content:has(#tab-dish-sales.active) .main-header,
.main-content:has(#tab-dish-sales-trend.active) .main-header,
.main-content:has(#tab-dish-sales-catalog.active) .main-header,
#tab-dish-sales .dish-sales-toolbar,
#tab-dish-sales-trend .recon-section-title,
#tab-dish-sales-catalog .dish-catalog-toolbar {
  position: static !important;
  top: auto !important;
  z-index: auto !important;
  backdrop-filter: none !important;
}

/* 菜品销售：固定=头部和操作区留在布局里不动，下面内容区单独滚动；不是悬浮覆盖 */
.main-content:has(#tab-dish-sales.active),
.main-content:has(#tab-dish-sales-trend.active),
.main-content:has(#tab-dish-sales-catalog.active) {
  overflow: hidden !important;
}
#tab-dish-sales.active,
#tab-dish-sales-trend.active,
#tab-dish-sales-catalog.active {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
#tab-dish-sales .dish-sales-shell,
#tab-dish-sales-trend .dish-sales-shell,
#tab-dish-sales-catalog .dish-catalog-shell {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#tab-dish-sales .dish-five-grid,
#tab-dish-sales-trend .dish-month-analysis-section,
#tab-dish-sales-catalog .dish-catalog-section {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: .35rem;
}
#tab-dish-sales .dish-sales-toolbar,
#tab-dish-sales .dish-kpi-grid,
#tab-dish-sales .dish-top-category-bar,
#tab-dish-sales-catalog .dish-catalog-toolbar,
#tab-dish-sales-trend .recon-section-title {
  flex: 0 0 auto;
}
#tab-dish-sales-catalog .dish-catalog-section .recon-section-body,
#tab-dish-sales-catalog .dish-catalog-section .table-container {
  overflow: visible !important;
  max-height: none !important;
}

.dish-catalog-table tr.dish-catalog-row-changed td {
  background: rgba(251,191,36,.12) !important;
  box-shadow: inset 3px 0 0 #fbbf24;
}
.dish-catalog-table tr.dish-catalog-row-changed td:first-child::after {
  content: ' 已调整';
  display: inline-flex;
  margin-left: .5rem;
  padding: .12rem .4rem;
  border-radius: 999px;
  background: rgba(251,191,36,.18);
  color: #fbbf24;
  font-size: .62rem;
  font-weight: 900;
}

/* 新上传数据中新出现的菜品高亮；手动编辑不改变当前筛选分组 */
.dish-catalog-table tr.dish-catalog-row-new td {
  background: rgba(56,189,248,.12) !important;
  box-shadow: inset 3px 0 0 #38bdf8;
}
.dish-catalog-table tr.dish-catalog-row-new td:first-child::after {
  content: ' 待核对';
  display: inline-flex;
  margin-left: .5rem;
  padding: .12rem .4rem;
  border-radius: 999px;
  background: rgba(56,189,248,.18);
  color: #67e8f9;
  font-size: .62rem;
  font-weight: 900;
}
/* 覆盖旧的“已调整”高亮文案 */
.dish-catalog-table tr.dish-catalog-row-changed td { background: inherit !important; box-shadow:none !important; }
.dish-catalog-table tr.dish-catalog-row-changed td:first-child::after { content:none !important; }

/* 菜品管理：分类用颜色区分，避免整表看花 */
.dish-catalog-table tbody tr { border-left: 5px solid transparent; }
.dish-catalog-table tbody tr.dish-cat-basemat { border-left-color:#a78bfa; }
.dish-catalog-table tbody tr.dish-cat-meat { border-left-color:#fb7185; }
.dish-catalog-table tbody tr.dish-cat-veg { border-left-color:#4ade80; }
.dish-catalog-table tbody tr.dish-cat-snack { border-left-color:#fbbf24; }
.dish-catalog-table tbody tr.dish-cat-staple { border-left-color:#fb923c; }
.dish-catalog-table tbody tr.dish-cat-alcohol { border-left-color:#60a5fa; }
.dish-catalog-table tbody tr.dish-cat-drink { border-left-color:#22d3ee; }
.dish-catalog-table tbody tr.dish-cat-other { border-left-color:#94a3b8; }
.dish-catalog-table tbody tr.dish-cat-basemat td { background:rgba(167,139,250,.035); }
.dish-catalog-table tbody tr.dish-cat-meat td { background:rgba(251,113,133,.035); }
.dish-catalog-table tbody tr.dish-cat-veg td { background:rgba(74,222,128,.032); }
.dish-catalog-table tbody tr.dish-cat-snack td { background:rgba(251,191,36,.034); }
.dish-catalog-table tbody tr.dish-cat-staple td { background:rgba(251,146,60,.034); }
.dish-catalog-table tbody tr.dish-cat-alcohol td { background:rgba(96,165,250,.034); }
.dish-catalog-table tbody tr.dish-cat-drink td { background:rgba(34,211,238,.034); }
.dish-catalog-table tbody tr.dish-cat-other td { background:rgba(148,163,184,.026); }
.dish-catalog-table select[data-catalog-category] { font-weight:900; }
.dish-catalog-table tr.dish-cat-basemat select[data-catalog-category] { color:#c4b5fd; }
.dish-catalog-table tr.dish-cat-meat select[data-catalog-category] { color:#fda4af; }
.dish-catalog-table tr.dish-cat-veg select[data-catalog-category] { color:#86efac; }
.dish-catalog-table tr.dish-cat-snack select[data-catalog-category] { color:#fde68a; }
.dish-catalog-table tr.dish-cat-staple select[data-catalog-category] { color:#fdba74; }
.dish-catalog-table tr.dish-cat-alcohol select[data-catalog-category] { color:#93c5fd; }
.dish-catalog-table tr.dish-cat-drink select[data-catalog-category] { color:#67e8f9; }
.dish-catalog-table tr.dish-cat-other select[data-catalog-category] { color:#cbd5e1; }
#dish-catalog-category-filter-chips .dish-category-chip[data-catalog-filter-category="底料类"].active { background:#a78bfa!important; border-color:#a78bfa!important; color:#111827!important; }
#dish-catalog-category-filter-chips .dish-category-chip[data-catalog-filter-category="荤菜类"].active { background:#fb7185!important; border-color:#fb7185!important; color:#111827!important; }
#dish-catalog-category-filter-chips .dish-category-chip[data-catalog-filter-category="青菜类"].active { background:#4ade80!important; border-color:#4ade80!important; color:#111827!important; }
#dish-catalog-category-filter-chips .dish-category-chip[data-catalog-filter-category="甜品小吃类"].active { background:#fbbf24!important; border-color:#fbbf24!important; color:#111827!important; }
#dish-catalog-category-filter-chips .dish-category-chip[data-catalog-filter-category="主食类"].active { background:#fb923c!important; border-color:#fb923c!important; color:#111827!important; }
#dish-catalog-category-filter-chips .dish-category-chip[data-catalog-filter-category="酒水类"].active { background:#60a5fa!important; border-color:#60a5fa!important; color:#111827!important; }
#dish-catalog-category-filter-chips .dish-category-chip[data-catalog-filter-category="饮料类"].active { background:#22d3ee!important; border-color:#22d3ee!important; color:#111827!important; }
#dish-catalog-category-filter-chips .dish-category-chip[data-catalog-filter-category="其他类"].active { background:#94a3b8!important; border-color:#94a3b8!important; color:#111827!important; }

/* 菜品管理：取消分类彩色行，避免看花；只保留“待核对”和合并分组提示 */
.dish-catalog-table tbody tr[class*="dish-cat-"] { border-left-color: transparent !important; }
.dish-catalog-table tbody tr[class*="dish-cat-"] td { background: transparent !important; }
.dish-catalog-table tbody tr[class*="dish-cat-"] select[data-catalog-category] { color: inherit !important; }
#dish-catalog-category-filter-chips .dish-category-chip.active { background: rgba(245,158,11,.18) !important; border-color: rgba(245,158,11,.7) !important; color: #fbbf24 !important; }
.dish-catalog-table tr.dish-merge-group-row td {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(15,23,42,.96) !important;
  color: #fbbf24;
  font-weight: 900;
  letter-spacing: .02em;
  border-top: 1px solid rgba(251,191,36,.35);
  border-bottom: 1px solid rgba(251,191,36,.22);
}
.dish-catalog-table tr.dish-merge-group-row span {
  margin-left: .7rem;
  color: rgba(255,255,255,.58);
  font-size: .76rem;
}

.dish-review-btn {
  border: 1px solid rgba(56,189,248,.55);
  background: rgba(56,189,248,.14);
  color: #67e8f9;
  border-radius: 999px;
  padding: .22rem .55rem;
  font-size: .72rem;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}
.dish-review-btn:hover { background: rgba(56,189,248,.24); }
.dish-reviewed-mark { color: rgba(255,255,255,.32); font-size: .72rem; white-space: nowrap; }
#btn-clear-dish-pending { border:1px solid rgba(56,189,248,.4); color:#67e8f9; background:rgba(56,189,248,.08); }

.dish-review-reason {
  display:inline-flex;
  max-width: 18rem;
  white-space: normal;
  line-height: 1.25;
  padding:.2rem .5rem;
  border-radius: 999px;
  background: rgba(56,189,248,.14);
  color:#67e8f9;
  font-size:.72rem;
  font-weight:900;
}
.dish-merged-child-row td:first-child {
  color: rgba(255,255,255,.72);
  padding-left: 1.6rem !important;
}
.dish-merged-child-row td {
  background: rgba(56,189,248,.055) !important;
}

.dish-catalog-table tr.dish-unmatched-separator td {
  background: rgba(251,146,60,.14) !important;
  color: #fdba74;
  font-weight: 900;
  border-top: 1px solid rgba(251,146,60,.35);
  border-bottom: 1px solid rgba(251,146,60,.25);
  padding: .85rem 1rem !important;
}
.dish-catalog-table tr.dish-unmatched-separator span {
  margin-left: .8rem;
  color: rgba(255,255,255,.62);
  font-size: .76rem;
}

/* 非 Excel 正式菜品名：统一用橙色文字，和 Excel 菜品名区分 */
.dish-catalog-table tr.dish-non-excel-row td:first-child {
  color: #fdba74 !important;
}
.dish-catalog-table tr.dish-non-excel-row td:first-child .dish-non-excel-tag {
  display: inline-flex;
  margin-left: .55rem;
  padding: .12rem .42rem;
  border-radius: 999px;
  background: rgba(251,146,60,.16);
  color: #fdba74;
  border: 1px solid rgba(251,146,60,.35);
  font-size: .62rem;
  font-weight: 900;
  vertical-align: middle;
}

.dish-merged-stat-note {
  display:inline-flex;
  padding:.2rem .5rem;
  border-radius:999px;
  background:rgba(34,197,94,.13);
  color:#86efac;
  border:1px solid rgba(34,197,94,.32);
  font-size:.72rem;
  font-weight:900;
  white-space:nowrap;
}

.dish-merged-stat-note.stopped {
  background: rgba(239, 68, 68, 0.13);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.32);
}

.dish-excel-tag {
  display:inline-flex;
  margin-left:.55rem;
  padding:.12rem .42rem;
  border-radius:999px;
  background:rgba(34,197,94,.12);
  color:#86efac;
  border:1px solid rgba(34,197,94,.28);
  font-size:.62rem;
  font-weight:900;
  vertical-align:middle;
}
.dish-excel-merge-lock {
  display:inline-flex;
  padding:.28rem .6rem;
  border-radius:999px;
  background:rgba(148,163,184,.10);
  color:rgba(255,255,255,.54);
  border:1px solid rgba(148,163,184,.20);
  font-size:.76rem;
  font-weight:800;
  white-space:nowrap;
}

.dish-excel-stat-note {
  display:inline-flex;
  padding:.2rem .5rem;
  border-radius:999px;
  background:rgba(245,158,11,.12);
  color:#fbbf24;
  border:1px solid rgba(245,158,11,.28);
  font-size:.72rem;
  font-weight:900;
  white-space:nowrap;
}

/* 菜品销售：顶部三块区域统一高度、间距和视觉比例 */
#tab-dish-sales .dish-sales-shell {
  gap: .85rem !important;
}
#tab-dish-sales .dish-sales-toolbar {
  min-height: 72px !important;
  padding: .75rem 1rem !important;
  justify-content: center !important;
  align-items: center !important;
  gap: .55rem !important;
  border-radius: 14px !important;
}
#tab-dish-sales .dish-sales-toolbar .dish-month-chip-row {
  width: auto !important;
  flex: 0 1 auto !important;
  margin: 0 !important;
  justify-content: center !important;
  align-items: center !important;
  gap: .5rem !important;
}
#tab-dish-sales .dish-sales-toolbar .analysis-month-chip {
  min-height: 34px !important;
  padding: .38rem .82rem !important;
  font-size: .78rem !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
#tab-dish-sales #btn-dish-sales-upload {
  min-height: 40px !important;
  padding: .48rem 1rem !important;
  margin-left: .7rem !important;
  border-radius: 12px !important;
  font-size: .82rem !important;
}
#tab-dish-sales .dish-kpi-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: .75rem !important;
  margin: 0 !important;
}
#tab-dish-sales .dish-kpi-grid .recon-mini-card {
  min-height: 108px !important;
  padding: .9rem 1rem !important;
  border-radius: 14px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
}
#tab-dish-sales .dish-kpi-grid .recon-mini-card span {
  font-size: .78rem !important;
  line-height: 1.1 !important;
  margin-bottom: .45rem !important;
}
#tab-dish-sales .dish-kpi-grid .recon-mini-card strong {
  font-size: 1.42rem !important;
  line-height: 1.05 !important;
  margin: 0 !important;
}
#tab-dish-sales .dish-top-category-bar {
  min-height: 60px !important;
  padding: .6rem .85rem !important;
  gap: .75rem !important;
  border-radius: 14px !important;
  align-items: center !important;
}
#tab-dish-sales .dish-top-category-bar > span {
  flex: 0 0 auto !important;
  font-size: .84rem !important;
  white-space: nowrap !important;
}
#tab-dish-sales .dish-top-category-bar .dish-category-chips {
  display: grid !important;
  grid-template-columns: repeat(8, minmax(92px, 1fr)) !important;
  gap: .45rem !important;
  margin-left: 0 !important;
  width: 100% !important;
}
#tab-dish-sales .dish-top-category-bar .dish-category-chip {
  min-height: 34px !important;
  padding: .38rem .6rem !important;
  font-size: .76rem !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
@media (max-width: 1350px) {
  #tab-dish-sales .dish-sales-toolbar { justify-content: flex-start !important; }
  #tab-dish-sales .dish-sales-toolbar .dish-month-chip-row { justify-content: flex-start !important; }
  #tab-dish-sales .dish-kpi-grid { grid-template-columns: repeat(3, minmax(0,1fr)) !important; }
  #tab-dish-sales .dish-top-category-bar .dish-category-chips { grid-template-columns: repeat(4, minmax(92px,1fr)) !important; }
}

/* 菜品销售顶部三行重新压平：不换行、高度一致 */
#tab-dish-sales .dish-sales-shell {
  gap: .72rem !important;
}
#tab-dish-sales .dish-sales-toolbar {
  min-height: 72px !important;
  height: 72px !important;
  padding: .45rem .9rem !important;
  border-radius: 14px !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  justify-content: center !important;
  align-items: center !important;
  gap: .55rem !important;
}
#tab-dish-sales .dish-sales-toolbar .dish-month-chip-row {
  flex: 0 1 auto !important;
  width: auto !important;
  margin: 0 !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  justify-content: center !important;
  align-items: center !important;
  gap: .42rem !important;
}
#tab-dish-sales .dish-sales-toolbar .analysis-month-chip {
  min-height: 32px !important;
  height: 32px !important;
  padding: 0 .72rem !important;
  font-size: .74rem !important;
  line-height: 32px !important;
  white-space: nowrap !important;
}
#tab-dish-sales #btn-dish-sales-upload {
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 .9rem !important;
  margin-left: .55rem !important;
  white-space: nowrap !important;
}
#tab-dish-sales .dish-kpi-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: .7rem !important;
  margin: 0 !important;
}
#tab-dish-sales .dish-kpi-grid .recon-mini-card {
  min-height: 86px !important;
  height: 86px !important;
  padding: .62rem .9rem !important;
  border-radius: 14px !important;
  justify-content: center !important;
}
#tab-dish-sales .dish-kpi-grid .recon-mini-card span {
  font-size: .74rem !important;
  margin-bottom: .35rem !important;
}
#tab-dish-sales .dish-kpi-grid .recon-mini-card strong {
  font-size: 1.28rem !important;
  line-height: 1.05 !important;
}
#tab-dish-sales .dish-top-category-bar {
  min-height: 72px !important;
  height: 72px !important;
  padding: .45rem .8rem !important;
  border-radius: 14px !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: .65rem !important;
}
#tab-dish-sales .dish-top-category-bar > span {
  flex: 0 0 74px !important;
  font-size: .82rem !important;
  white-space: nowrap !important;
}
#tab-dish-sales .dish-top-category-bar .dish-category-chips {
  flex: 1 1 auto !important;
  width: auto !important;
  margin: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(9, minmax(74px, 1fr)) !important;
  gap: .42rem !important;
  align-items: center !important;
}
#tab-dish-sales .dish-top-category-bar .dish-category-chip {
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 .5rem !important;
  font-size: .72rem !important;
  line-height: 32px !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
@media (max-width: 1500px) {
  #tab-dish-sales .dish-sales-toolbar { justify-content: flex-start !important; overflow-x: auto !important; }
  #tab-dish-sales .dish-top-category-bar { overflow-x: auto !important; }
  #tab-dish-sales .dish-top-category-bar .dish-category-chips { grid-template-columns: repeat(9, minmax(82px, 1fr)) !important; min-width: 850px !important; }
}

/* FINAL：菜品销售顶部三块统一为等高单行，禁止换行撑高 */
#tab-dish-sales .dish-sales-shell {
  gap: 12px !important;
}
#tab-dish-sales .dish-sales-toolbar,
#tab-dish-sales .dish-top-category-bar {
  height: 72px !important;
  min-height: 72px !important;
  max-height: 72px !important;
  padding: 0 18px !important;
  border-radius: 16px !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
}
#tab-dish-sales .dish-sales-toolbar {
  justify-content: center !important;
  gap: 10px !important;
}
#tab-dish-sales .dish-sales-toolbar .dish-month-chip-row {
  flex: 0 0 auto !important;
  width: auto !important;
  margin: 0 !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
}
#tab-dish-sales .analysis-month-chip,
#tab-dish-sales #btn-dish-sales-upload,
#tab-dish-sales .dish-top-category-bar .dish-category-chip {
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  padding: 0 18px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  font-size: 14px !important;
  border-radius: 999px !important;
}
#tab-dish-sales #btn-dish-sales-upload {
  margin-left: 18px !important;
}
#tab-dish-sales .dish-kpi-grid {
  height: 72px !important;
  min-height: 72px !important;
  max-height: 72px !important;
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 12px !important;
  margin: 0 !important;
}
#tab-dish-sales .dish-kpi-grid .recon-mini-card {
  height: 72px !important;
  min-height: 72px !important;
  max-height: 72px !important;
  padding: 10px 18px !important;
  border-radius: 16px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
}
#tab-dish-sales .dish-kpi-grid .recon-mini-card span {
  font-size: 13px !important;
  line-height: 1 !important;
  margin: 0 0 8px !important;
}
#tab-dish-sales .dish-kpi-grid .recon-mini-card strong {
  font-size: 24px !important;
  line-height: 1 !important;
  margin: 0 !important;
  white-space: nowrap !important;
}
#tab-dish-sales .dish-top-category-bar {
  gap: 14px !important;
}
#tab-dish-sales .dish-top-category-bar > span {
  flex: 0 0 86px !important;
  font-size: 15px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}
#tab-dish-sales .dish-top-category-bar .dish-category-chips {
  flex: 1 0 auto !important;
  width: auto !important;
  margin: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(9, minmax(92px, 1fr)) !important;
  gap: 10px !important;
  align-items: center !important;
}
@media (max-width: 1500px) {
  #tab-dish-sales .dish-sales-toolbar { justify-content: flex-start !important; }
  #tab-dish-sales .dish-top-category-bar .dish-category-chips { min-width: 910px !important; }
}

/* 菜品销售统一设计系统：单月、月度分析、菜品管理共用同一顶部导航 */
#tab-dish-sales .dish-sales-shell,
#tab-dish-sales-trend .dish-sales-shell,
#tab-dish-sales-catalog .dish-catalog-shell {
  display:flex !important;
  flex-direction:column !important;
  gap:12px !important;
}
#tab-dish-sales .dish-module-nav,
#tab-dish-sales-trend .dish-module-nav,
#tab-dish-sales-catalog .dish-module-nav {
  position:relative;
  box-sizing:border-box;
  width:100%;
  height:72px !important;
  min-height:72px !important;
  max-height:72px !important;
  padding:0 18px !important;
  display:flex !important;
  flex-wrap:nowrap !important;
  align-items:center !important;
  justify-content:center !important;
  gap:12px !important;
  overflow-x:auto !important;
  overflow-y:hidden !important;
  border:1px solid rgba(255,255,255,.08);
  border-radius:16px;
  background:rgba(255,255,255,.025);
}
#tab-dish-sales .dish-module-nav .dish-month-chip-row,
#tab-dish-sales-trend .dish-module-nav .dish-month-chip-row,
#tab-dish-sales-catalog .dish-module-nav .dish-month-chip-row {
  width:auto !important;
  flex:0 0 auto !important;
  margin:0 !important;
  display:flex !important;
  flex-wrap:nowrap !important;
  align-items:center !important;
  justify-content:center !important;
  gap:8px !important;
}
#tab-dish-sales .dish-module-nav .analysis-month-chip,
#tab-dish-sales-trend .dish-module-nav .analysis-month-chip,
#tab-dish-sales-catalog .dish-module-nav .analysis-month-chip {
  box-sizing:border-box;
  height:36px !important;
  min-height:36px !important;
  padding:0 15px !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  white-space:nowrap !important;
  line-height:1 !important;
  font-size:13px !important;
  border-radius:999px !important;
}
#tab-dish-sales .dish-module-nav #btn-dish-sales-upload {
  position:absolute !important;
  right:18px !important;
  top:16px !important;
  height:40px !important;
  min-height:40px !important;
  margin:0 !important;
  padding:0 16px !important;
  border-radius:12px !important;
  white-space:nowrap !important;
}
/* 菜品管理操作栏与导航彻底分层 */
#tab-dish-sales-catalog .dish-catalog-toolbar {
  min-height:64px !important;
  padding:10px 14px !important;
  display:flex !important;
  align-items:center !important;
  gap:10px !important;
  flex-wrap:nowrap !important;
  border-radius:14px !important;
  overflow-x:auto !important;
}
#tab-dish-sales-catalog .dish-catalog-toolbar #dish-catalog-category-filter-chips { flex:1 0 auto !important; }
/* 单月总结 */
#tab-dish-sales .dish-month-summary {
  padding:16px;
  border:1px solid rgba(255,255,255,.09);
  border-radius:16px;
  background:rgba(255,255,255,.025);
}
.dish-summary-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin-bottom:12px; }
.dish-summary-heading > div { display:flex; align-items:baseline; gap:10px; }
.dish-summary-heading span { color:#a78bfa; font-size:13px; font-weight:900; }
.dish-summary-heading strong { color:#fff; font-size:17px; }
.dish-summary-heading em { color:#64748b; font-size:11px; font-style:normal; }
.dish-summary-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; }
.dish-insight-card { min-width:0; padding:12px 14px; border-radius:12px; background:rgba(255,255,255,.035); border:1px solid rgba(255,255,255,.07); }
.dish-insight-card span { display:block; color:#94a3b8; font-size:11px; font-weight:800; }
.dish-insight-card strong { display:block; margin:7px 0 5px; color:#fff; font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dish-insight-card b { font-size:16px; color:#cbd5e1; }
.dish-insight-card.best { border-color:rgba(74,222,128,.2); }
.dish-insight-card.best b { color:#4ade80; }
.dish-insight-card.weak { border-color:rgba(251,113,133,.2); }
.dish-insight-card.weak b { color:#fb7185; }
.dish-summary-advice { list-style:none; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px 14px; margin:12px 0 0; padding:12px 0 0; border-top:1px solid rgba(255,255,255,.07); }
.dish-summary-advice li { display:flex; align-items:center; gap:8px; color:#cbd5e1; font-size:12px; }
.dish-summary-advice li b { width:20px; height:20px; display:inline-flex; align-items:center; justify-content:center; border-radius:6px; background:rgba(251,191,36,.14); color:#fbbf24; font-size:10px; }
/* 跨月结论与逐月总结 */
#tab-dish-sales-trend .dish-month-analysis-section > .recon-section-body { padding:14px !important; }
.dish-period-overview { display:grid; grid-template-columns:minmax(240px,.8fr) 2fr; gap:18px; align-items:center; padding:14px 16px; margin-bottom:12px; border-radius:14px; border:1px solid rgba(251,191,36,.2); background:rgba(251,191,36,.055); }
.dish-period-overview span { display:block; color:#fbbf24; font-size:11px; font-weight:900; margin-bottom:5px; }
.dish-period-overview strong { color:#fff; font-size:15px; }
.dish-period-overview ul { margin:0; padding-left:18px; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px 18px; color:#cbd5e1; font-size:11px; }
.dish-month-review-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-bottom:12px; }
.dish-month-review-card { min-width:0; padding:12px; border:1px solid rgba(255,255,255,.08); border-radius:13px; background:rgba(255,255,255,.028); }
.dish-month-review-card header { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-bottom:10px; }
.dish-month-review-card header strong { color:#fff; font-size:14px; }
.dish-month-review-card header span { font-size:10px; font-weight:800; }
.dish-month-review-card header .up { color:#4ade80; }
.dish-month-review-card header .down { color:#fb7185; }
.dish-month-review-metrics { display:grid; grid-template-columns:repeat(3,1fr); gap:5px; margin-bottom:9px; }
.dish-month-review-metrics span { color:#64748b; font-size:9px; }
.dish-month-review-metrics b { display:block; margin-top:2px; color:#cbd5e1; font-size:11px; }
.dish-month-review-best,.dish-month-review-weak { display:grid; grid-template-columns:32px minmax(0,1fr) auto; gap:6px; align-items:center; padding:5px 0; font-size:10px; border-top:1px solid rgba(255,255,255,.055); }
.dish-month-review-best span { color:#4ade80; }.dish-month-review-weak span { color:#fb7185; }
.dish-month-review-best strong,.dish-month-review-weak strong { color:#fff; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dish-month-review-best b,.dish-month-review-weak b { color:#94a3b8; }
.dish-month-review-card p { margin:8px 0 0; color:#94a3b8; font-size:10px; line-height:1.4; }
@media(max-width:1500px){
  #tab-dish-sales .dish-module-nav,#tab-dish-sales-trend .dish-module-nav,#tab-dish-sales-catalog .dish-module-nav{justify-content:flex-start!important}
  #tab-dish-sales .dish-module-nav #btn-dish-sales-upload{position:sticky!important;right:0!important;top:auto!important;flex:0 0 auto!important}
  .dish-month-review-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}

/* 决策型分析：以停售/关注/维护替代无意义的单月第一倒数第一 */
.dish-decision-kpis { display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.dish-decision-kpis span { padding:7px 11px; border-radius:9px; background:rgba(255,255,255,.04); color:#94a3b8; font-size:11px; }
.dish-decision-kpis b { margin-left:5px; color:#fff; font-size:14px; }
.dish-action-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.dish-action-group { min-width:0; border:1px solid rgba(255,255,255,.08); border-radius:13px; overflow:hidden; background:rgba(255,255,255,.025); }
.dish-action-group > header { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:11px 13px; border-bottom:1px solid rgba(255,255,255,.07); }
.dish-action-group > header div { min-width:0; }
.dish-action-group > header strong { display:block; color:#fff; font-size:13px; }
.dish-action-group > header span { display:block; margin-top:3px; color:#64748b; font-size:9px; }
.dish-action-group > header > b { min-width:26px; height:26px; display:inline-flex; align-items:center; justify-content:center; border-radius:8px; font-size:12px; }
.dish-action-group.stop > header > b { background:rgba(251,113,133,.15); color:#fb7185; }
.dish-action-group.watch > header > b { background:rgba(251,191,36,.15); color:#fbbf24; }
.dish-action-group.focus > header > b { background:rgba(74,222,128,.14); color:#4ade80; }
.dish-action-group > div { max-height:238px; overflow:auto; }
.dish-action-group article { padding:9px 13px; border-bottom:1px solid rgba(255,255,255,.05); }
.dish-action-group article:last-child { border-bottom:0; }
.dish-action-group article strong { display:block; color:#fff; font-size:12px; }
.dish-action-group article span { display:block; margin-top:3px; color:#cbd5e1; font-size:10px; }
.dish-action-group article em { display:block; margin-top:4px; color:#64748b; font-size:9px; font-style:normal; line-height:1.35; }
.dish-action-group > div > p { margin:0; padding:18px 13px; color:#64748b; font-size:11px; }
.dish-category-actions { list-style:none; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px 12px; margin:12px 0 0; padding:12px 0 0; border-top:1px solid rgba(255,255,255,.07); }
.dish-category-actions li { display:flex; gap:8px; color:#94a3b8; font-size:10px; }
.dish-category-actions b { flex:0 0 auto; color:#a78bfa; }
.dish-month-action-line { display:grid; grid-template-columns:24px minmax(0,1fr); gap:6px; align-items:start; padding:5px 0; border-top:1px solid rgba(255,255,255,.055); font-size:10px; }
.dish-month-action-line span { width:20px; height:20px; display:inline-flex; align-items:center; justify-content:center; border-radius:6px; font-weight:900; }
.dish-month-action-line strong { color:#cbd5e1; font-weight:700; line-height:1.35; white-space:normal; }
.dish-month-action-line.stop span { color:#fb7185; background:rgba(251,113,133,.13); }
.dish-month-action-line.watch span { color:#fbbf24; background:rgba(251,191,36,.13); }
.dish-month-action-line.focus span { color:#4ade80; background:rgba(74,222,128,.12); }
@media(max-width:1100px){.dish-action-grid{grid-template-columns:1fr}.dish-category-actions{grid-template-columns:1fr}}

/* 月度分析：按分类查看核心/弱势菜曲线，底料不参与 */
.dish-trend-category-section { margin-bottom:12px; padding:14px; border:1px solid rgba(255,255,255,.09); border-radius:15px; background:rgba(255,255,255,.022); }
.dish-trend-category-head { display:flex; align-items:center; gap:14px; margin-bottom:12px; }
.dish-trend-category-head > strong { flex:0 0 auto; color:#fff; font-size:14px; }
#dish-trend-category-chips { display:grid; grid-template-columns:repeat(7,minmax(86px,1fr)); gap:8px; flex:1; }
#dish-trend-category-chips .dish-category-chip { min-height:34px; padding:0 10px; border:1px solid rgba(255,255,255,.12); border-radius:999px; background:rgba(255,255,255,.035); color:#94a3b8; font-size:11px; font-weight:900; cursor:pointer; }
#dish-trend-category-chips .dish-category-chip.active { color:#111827; background:#fbbf24; border-color:#fbbf24; }
.dish-category-analysis-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.dish-category-analysis-grid .dish-chart-card { min-height:290px !important; }
.dish-category-analysis-grid .dish-chart { height:245px !important; }
.dish-category-analysis-grid .dish-category-advice-card,.dish-category-analysis-grid .dish-category-zero-card { min-height:210px !important; }
.dish-category-advice-row { display:grid; grid-template-columns:22px minmax(0,1fr); gap:8px; padding:9px 0; border-bottom:1px solid rgba(255,255,255,.06); }
.dish-category-advice-row b { width:22px; height:22px; display:inline-flex; align-items:center; justify-content:center; border-radius:7px; background:rgba(251,191,36,.13); color:#fbbf24; font-size:10px; }
.dish-category-advice-row span { color:#cbd5e1; font-size:11px; line-height:1.45; }
.dish-zero-analysis-row { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:8px 0; border-bottom:1px solid rgba(255,255,255,.06); }
.dish-zero-analysis-row span { color:#cbd5e1; font-size:11px; }
.dish-zero-analysis-row b { color:#fbbf24; font-size:10px; white-space:nowrap; }
.dish-zero-analysis-row.critical b { color:#fb7185; }
@media(max-width:1100px){.dish-category-analysis-grid{grid-template-columns:1fr}#dish-trend-category-chips{display:flex;overflow-x:auto}.dish-trend-category-head{align-items:flex-start;flex-direction:column}}

/* 所有增减决策严格按分类展示；底料类不进入此区域 */
.dish-category-decision-list { display:grid; gap:10px; }
.dish-category-decision-block { border:1px solid rgba(255,255,255,.08); border-radius:13px; overflow:hidden; background:rgba(255,255,255,.02); }
.dish-category-decision-block > header { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:42px; padding:8px 12px; background:rgba(255,255,255,.035); border-bottom:1px solid rgba(255,255,255,.07); }
.dish-category-decision-block > header > strong { color:#fff; font-size:13px; }
.dish-category-decision-block > header > div { display:flex; gap:6px; }
.dish-category-decision-block > header span { padding:4px 7px; border-radius:7px; background:rgba(255,255,255,.05); color:#94a3b8; font-size:9px; }
.dish-category-decision-row { display:grid; grid-template-columns:78px minmax(0,1fr); border-bottom:1px solid rgba(255,255,255,.05); }
.dish-category-decision-row:last-child { border-bottom:0; }
.dish-category-decision-row > span { padding:10px 12px; font-size:10px; font-weight:900; border-right:1px solid rgba(255,255,255,.05); }
.dish-category-decision-row.stop > span { color:#fb7185; }.dish-category-decision-row.watch > span { color:#fbbf24; }.dish-category-decision-row.focus > span { color:#4ade80; }
.dish-category-decision-row > div { display:flex; flex-wrap:wrap; gap:7px; padding:8px 10px; }
.dish-category-decision-row article { min-width:180px; max-width:320px; padding:6px 8px; border-radius:8px; background:rgba(255,255,255,.035); }
.dish-category-decision-row article strong { display:block; color:#fff; font-size:10px; }
.dish-category-decision-row article em { display:block; margin-top:3px; color:#64748b; font-size:9px; font-style:normal; line-height:1.3; }
.dish-category-decision-row i { color:#475569; font-size:10px; font-style:normal; padding:5px 0; }
.dish-trend-decision-group { margin-bottom:9px; border:1px solid rgba(255,255,255,.07); border-radius:10px; overflow:hidden; }
.dish-trend-decision-group header { display:grid; grid-template-columns:22px 1fr auto; gap:7px; align-items:center; padding:7px 9px; background:rgba(255,255,255,.035); }
.dish-trend-decision-group header b { width:22px; height:22px; display:inline-flex; align-items:center; justify-content:center; border-radius:6px; font-size:10px; }
.dish-trend-decision-group.stop header b { color:#fb7185;background:rgba(251,113,133,.13) }.dish-trend-decision-group.watch header b { color:#fbbf24;background:rgba(251,191,36,.13) }.dish-trend-decision-group.focus header b { color:#4ade80;background:rgba(74,222,128,.12) }
.dish-trend-decision-group header strong { color:#fff; font-size:11px; }.dish-trend-decision-group header span { color:#64748b; font-size:10px; }
.dish-trend-decision-group article { padding:7px 10px; border-top:1px solid rgba(255,255,255,.05); }
.dish-trend-decision-group article strong { display:block; color:#cbd5e1; font-size:10px; }.dish-trend-decision-group article em { display:block; margin-top:2px; color:#64748b; font-size:9px; font-style:normal; }
.dish-trend-decision-group > i { display:block; padding:8px 10px; color:#475569; font-size:9px; font-style:normal; }
.dish-month-overview-line { display:flex; align-items:center; justify-content:space-between; padding:7px 0; border-top:1px solid rgba(255,255,255,.06); color:#94a3b8; font-size:10px; }.dish-month-overview-line strong{color:#cbd5e1}

/* 强制恢复并优先展示用户原有 Top 系列；单月页使用整体滚动，禁止被 flex 内容区吞掉 */
#tab-dish-sales.active {
  display:block !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
}
#tab-dish-sales .dish-sales-shell {
  height:auto !important;
  min-height:100% !important;
  overflow:visible !important;
}
#tab-dish-sales .dish-five-grid {
  order:4 !important;
  flex:0 0 auto !important;
  width:100% !important;
  height:auto !important;
  display:grid !important;
  grid-template-columns:repeat(5,minmax(0,1fr)) !important;
  align-items:start !important;
  gap:10px !important;
  overflow:visible !important;
  padding:0 !important;
}
/* Top4 columns: flex column, JS doesn't touch their height */
#tab-dish-sales .dish-five-grid > .recon-section:not(.dish-rank-zero) {
  display:flex !important;
  flex-direction:column !important;
  visibility:visible !important;
  opacity:1 !important;
  height:auto !important;
  min-height:0 !important;
  overflow:visible !important;
}
/* top-4 columns body+list: show all content, no clipping */
#tab-dish-sales .dish-five-grid > .recon-section:not(.dish-rank-zero) .recon-section-body {
  display:block !important;
  height:auto !important;
  max-height:none !important;
  overflow:visible !important;
}
#tab-dish-sales .dish-five-grid > .recon-section:not(.dish-rank-zero) .recon-scroll-list {
  height:auto !important;
  max-height:none !important;
  overflow:visible !important;
}
#tab-dish-sales .dish-month-summary {
  order:5 !important;
  flex:0 0 auto !important;
}
@media(max-width:1350px){
  #tab-dish-sales .dish-five-grid{grid-template-columns:repeat(5,minmax(180px,1fr))!important;overflow-x:auto!important;padding-bottom:8px!important}
}
/* 手机端：五列横向滚动网格会把 0销售等区块挤到屏幕外，靠左右滑动才能看到，
   容易被当成"滑不动"；改回单列纵向堆叠，交回整页纵向滚动 */
@media(max-width:768px){
  #tab-dish-sales .dish-five-grid{
    grid-template-columns:1fr!important;
    overflow-x:visible!important;
    overflow-y:visible!important;
    padding-bottom:0!important;
  }
  #tab-dish-sales .dish-five-grid .dish-rank-zero{
    grid-column:auto!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:visible!important;
  }
  #tab-dish-sales .dish-rank-zero .recon-section-body{
    overflow:visible!important;
    max-height:none!important;
  }
  #tab-dish-sales .dish-rank-zero .recon-scroll-list{
    height:auto!important;
    max-height:none!important;
    overflow:visible!important;
  }
}

/* 单月页：同一个分类筛选同时驱动 Top 与经营建议 */
.dish-selected-summary { display:flex; align-items:center; gap:8px; margin-bottom:10px; }
.dish-selected-summary span { padding:6px 9px; border-radius:8px; background:rgba(255,255,255,.04); color:#94a3b8; font-size:10px; }
.dish-selected-summary b { margin-left:4px; color:#fff; font-size:12px; }
#tab-dish-sales .dish-action-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
#tab-dish-sales .dish-action-group > div { max-height:250px; overflow-y:auto; }
#tab-dish-sales .dish-action-group article > div { display:flex; align-items:center; gap:7px; min-width:0; }
#tab-dish-sales .dish-action-group article > div strong { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#tab-dish-sales .dish-action-group article > div i { flex:0 0 auto; padding:2px 5px; border-radius:5px; background:rgba(167,139,250,.11); color:#a78bfa; font-size:8px; font-style:normal; }
#tab-dish-sales .dish-month-summary { padding:14px !important; }
#tab-dish-sales .dish-summary-heading { margin-bottom:10px !important; }
@media(max-width:1000px){#tab-dish-sales .dish-action-grid{grid-template-columns:1fr}}

/* 0销售面板：JS syncDishZeroHeight() 控制高度与左侧Top列等高，超出内部滚动 */
#tab-dish-sales .dish-five-grid .dish-rank-zero {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#tab-dish-sales .dish-rank-zero .recon-section-title {
  flex: 0 0 auto;
}
#tab-dish-sales .dish-rank-zero .recon-section-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 0.4rem 0.5rem !important;
}
#tab-dish-sales .dish-rank-zero .recon-scroll-list {
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(148,163,184,.32) transparent;
}
#tab-dish-sales .dish-rank-zero .dish-zero-row {
  box-sizing: border-box !important;
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  padding: 0 .05rem !important;
}
#tab-dish-sales .dish-rank-zero .recon-scroll-list::-webkit-scrollbar { width: 6px; }
#tab-dish-sales .dish-rank-zero .recon-scroll-list::-webkit-scrollbar-thumb { background: rgba(148,163,184,.28); border-radius: 999px; }

/* FINAL UI SYSTEM：三个子页面的抬头、主导航、分类导航完全共用尺寸与节奏 */
#tab-dish-sales #dish-sales-kpis { display:none !important; }
#tab-dish-sales .dish-module-nav,
#tab-dish-sales-trend .dish-module-nav,
#tab-dish-sales-catalog .dish-module-nav {
  box-sizing:border-box !important;
  width:100% !important;
  height:68px !important;
  min-height:68px !important;
  max-height:68px !important;
  margin:0 !important;
  padding:0 18px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  border:1px solid rgba(255,255,255,.085) !important;
  border-radius:15px !important;
  background:rgba(255,255,255,.025) !important;
  overflow-x:auto !important;
  overflow-y:hidden !important;
}
#tab-dish-sales .dish-module-nav .dish-month-chip-row,
#tab-dish-sales-trend .dish-module-nav .dish-month-chip-row,
#tab-dish-sales-catalog .dish-module-nav .dish-month-chip-row {
  display:flex !important;
  flex:0 0 auto !important;
  width:auto !important;
  margin:0 !important;
  padding:0 !important;
  align-items:center !important;
  justify-content:center !important;
  flex-wrap:nowrap !important;
  gap:8px !important;
}
#tab-dish-sales .dish-module-nav .analysis-month-chip,
#tab-dish-sales-trend .dish-module-nav .analysis-month-chip,
#tab-dish-sales-catalog .dish-module-nav .analysis-month-chip {
  box-sizing:border-box !important;
  height:38px !important;
  min-height:38px !important;
  padding:0 16px !important;
  border-radius:999px !important;
  border:1px solid rgba(255,255,255,.14) !important;
  background:rgba(255,255,255,.035) !important;
  color:#94a3b8 !important;
  font-size:13px !important;
  font-weight:850 !important;
  line-height:1 !important;
  white-space:nowrap !important;
  transition:background-color .18s ease,border-color .18s ease,color .18s ease !important;
}
#tab-dish-sales .dish-module-nav .analysis-month-chip.active,
#tab-dish-sales-trend .dish-module-nav .analysis-month-chip.active,
#tab-dish-sales-catalog .dish-module-nav .analysis-month-chip.active {
  color:#111827 !important;
  background:#fbbf24 !important;
  border-color:#fbbf24 !important;
}
/* 第二行在三个页面保持同一位置、同一高度、同一分类色块 */
#tab-dish-sales .dish-context-bar,
#tab-dish-sales-trend .dish-context-bar,
#tab-dish-sales-catalog .dish-context-bar {
  box-sizing:border-box !important;
  width:100% !important;
  height:58px !important;
  min-height:58px !important;
  max-height:58px !important;
  margin:0 !important;
  padding:0 14px !important;
  display:flex !important;
  flex:0 0 58px !important;
  align-items:center !important;
  gap:12px !important;
  border:1px solid rgba(255,255,255,.085) !important;
  border-radius:14px !important;
  background:rgba(255,255,255,.022) !important;
  overflow-x:auto !important;
  overflow-y:hidden !important;
}
#tab-dish-sales .dish-context-bar > span,
#tab-dish-sales-trend .dish-context-bar > span,
#tab-dish-sales-catalog .dish-context-bar > span {
  flex:0 0 50px !important;
  color:#e2e8f0 !important;
  font-size:12px !important;
  font-weight:900 !important;
  text-align:center !important;
  white-space:nowrap !important;
}
#tab-dish-sales .dish-context-bar .dish-category-chips,
#tab-dish-sales-trend .dish-context-bar .dish-category-chips,
#tab-dish-sales-catalog .dish-context-bar .dish-category-chips {
  display:grid !important;
  grid-auto-flow:column !important;
  grid-auto-columns:minmax(94px,1fr) !important;
  flex:1 0 auto !important;
  width:auto !important;
  min-width:max-content !important;
  margin:0 !important;
  gap:8px !important;
  align-items:center !important;
}
#tab-dish-sales .dish-context-bar .dish-category-chip,
#tab-dish-sales-trend .dish-context-bar .dish-category-chip,
#tab-dish-sales-catalog .dish-context-bar .dish-category-chip {
  box-sizing:border-box !important;
  height:34px !important;
  min-height:34px !important;
  padding:0 12px !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  border-radius:999px !important;
  border:1px solid rgba(255,255,255,.13) !important;
  background:rgba(255,255,255,.032) !important;
  color:#94a3b8 !important;
  font-size:11px !important;
  font-weight:850 !important;
  line-height:1 !important;
  white-space:nowrap !important;
  cursor:pointer !important;
  transition:background-color .18s ease,border-color .18s ease,color .18s ease !important;
}
#tab-dish-sales .dish-context-bar .dish-category-chip.active,
#tab-dish-sales-trend .dish-context-bar .dish-category-chip.active,
#tab-dish-sales-catalog .dish-context-bar .dish-category-chip.active {
  color:#111827 !important;
  background:#fbbf24 !important;
  border-color:#fbbf24 !important;
}
/* 菜品管理的工具只在第三行出现，不再破坏前两行空间连续性 */
#tab-dish-sales-catalog .dish-catalog-toolbar {
  box-sizing:border-box !important;
  min-height:58px !important;
  height:58px !important;
  max-height:58px !important;
  margin:0 !important;
  padding:8px 12px !important;
  gap:9px !important;
  border:1px solid rgba(255,255,255,.075) !important;
  border-radius:13px !important;
  background:rgba(255,255,255,.018) !important;
}
/* 三个页面内容切换只做轻微淡入，布局尺寸不参与动画，避免跳动 */
#tab-dish-sales.active > *,#tab-dish-sales-trend.active > *,#tab-dish-sales-catalog.active > * { animation:dishContentIn .16s ease-out both; }
@keyframes dishContentIn { from{opacity:.82} to{opacity:1} }
@media(prefers-reduced-motion:reduce){#tab-dish-sales.active > *,#tab-dish-sales-trend.active > *,#tab-dish-sales-catalog.active > *{animation:none}}
@media(max-width:1500px){
 #tab-dish-sales .dish-module-nav,#tab-dish-sales-trend .dish-module-nav,#tab-dish-sales-catalog .dish-module-nav{justify-content:flex-start!important}
}

/* 单一持久控制区：切换月度分析/月份/菜品管理时 DOM 不替换，彻底消除抬头跳动 */
#dish-shared-controls { display:none; flex:0 0 auto; flex-direction:column; gap:12px; width:100%; margin:0 0 12px; }
.main-content:has(#tab-dish-sales.active) #dish-shared-controls,
.main-content:has(#tab-dish-sales-trend.active) #dish-shared-controls,
.main-content:has(#tab-dish-sales-catalog.active) #dish-shared-controls { display:flex !important; }
/* 面板内部旧导航退出布局，只保留唯一共享导航 */
#tab-dish-sales .dish-module-nav,#tab-dish-sales-trend .dish-module-nav,#tab-dish-sales-catalog .dish-module-nav,
#tab-dish-sales .dish-context-bar,#tab-dish-sales-trend .dish-context-bar,#tab-dish-sales-catalog .dish-context-bar { display:none !important; }
.dish-shared-nav,.dish-shared-context {
  box-sizing:border-box;
  width:100%;
  margin:0;
  display:flex;
  flex-wrap:nowrap;
  align-items:center;
  border:1px solid rgba(255,255,255,.085);
  background:rgba(255,255,255,.025);
  overflow-x:auto;
  overflow-y:hidden;
}
.dish-shared-nav { position:relative; height:68px; min-height:68px; padding:0 18px; justify-content:center; gap:12px; border-radius:15px; }
.dish-shared-nav .dish-month-chip-row { flex:0 0 auto; width:auto; margin:0; padding:0; display:flex; flex-wrap:nowrap; align-items:center; justify-content:center; gap:8px; }
.dish-shared-nav .analysis-month-chip { box-sizing:border-box; height:38px; min-height:38px; padding:0 16px; display:inline-flex; align-items:center; justify-content:center; border:1px solid rgba(255,255,255,.14); border-radius:999px; background:rgba(255,255,255,.035); color:#94a3b8; font-size:13px; font-weight:850; line-height:1; white-space:nowrap; cursor:pointer; transition:background-color .18s ease,border-color .18s ease,color .18s ease; }
.dish-shared-nav .analysis-month-chip.active { color:#111827; background:#fbbf24; border-color:#fbbf24; }
.dish-shared-nav #btn-dish-sales-upload { position:absolute; right:14px; top:14px; box-sizing:border-box; height:40px; min-height:40px; margin:0; padding:0 14px; border-radius:11px; white-space:nowrap; }
.dish-shared-context { height:58px; min-height:58px; padding:0 14px; gap:12px; border-radius:14px; }
.dish-shared-context > span { flex:0 0 50px; color:#e2e8f0; text-align:center; font-size:12px; font-weight:900; }
.dish-shared-context .dish-category-chips { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(94px,1fr); flex:1 0 auto; width:auto; min-width:max-content; margin:0; gap:8px; align-items:center; }
.dish-shared-context .dish-category-chip { box-sizing:border-box; height:34px; min-height:34px; padding:0 12px; display:inline-flex; align-items:center; justify-content:center; border:1px solid rgba(255,255,255,.13); border-radius:999px; background:rgba(255,255,255,.032); color:#94a3b8; font-size:11px; font-weight:850; line-height:1; white-space:nowrap; cursor:pointer; transition:background-color .18s ease,border-color .18s ease,color .18s ease; }
.dish-shared-context .dish-category-chip.active { color:#111827; background:#fbbf24; border-color:#fbbf24; }
/* 所有子页面从同一基线开始，清除旧导航留下的尺寸差异 */
#tab-dish-sales.active,#tab-dish-sales-trend.active,#tab-dish-sales-catalog.active { margin:0 !important; padding-top:0 !important; }
#tab-dish-sales .dish-sales-shell,#tab-dish-sales-trend .dish-sales-shell,#tab-dish-sales-catalog .dish-catalog-shell { gap:12px !important; }
@media(max-width:1500px){.dish-shared-nav{justify-content:flex-start}.dish-shared-nav #btn-dish-sales-upload{position:sticky;right:0;top:auto;flex:0 0 auto}.dish-shared-context .dish-category-chips{grid-auto-columns:minmax(90px,1fr)}}

/* UI/UX skill consistency rule: every subview renders the exact same 9-column category rail */
#dish-shared-category-chips {
  box-sizing:border-box !important;
  display:grid !important;
  grid-template-columns:repeat(9,minmax(96px,1fr)) !important;
  grid-auto-flow:row !important;
  grid-auto-columns:unset !important;
  flex:1 1 auto !important;
  width:100% !important;
  min-width:930px !important;
  gap:8px !important;
  margin:0 !important;
}
#dish-shared-category-chips .dish-category-chip {
  box-sizing:border-box !important;
  width:100% !important;
  min-width:0 !important;
  max-width:none !important;
  height:34px !important;
  min-height:34px !important;
  max-height:34px !important;
  margin:0 !important;
  padding:0 10px !important;
  line-height:1 !important;
  transform:none !important;
}
#dish-shared-category-chips .dish-category-chip.disabled,
#dish-shared-category-chips .dish-category-chip:disabled {
  opacity:.38 !important;
  cursor:not-allowed !important;
  color:#64748b !important;
  background:rgba(255,255,255,.018) !important;
  border-color:rgba(255,255,255,.07) !important;
}

/* ==========================================
   Redesigned 6-Month Trend Dashboard
   ========================================== */
#tab-dish-sales-trend .dish-mom-analysis-section {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
}

/* Period comparison label */
.dish-compare-period-label {
  font-size: 0.85rem !important;
  color: #fbbf24 !important;
  font-weight: 500;
  margin-left: auto;
}

/* 6-Month Store Overview Info styling */
.dish-period-overview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 20px;
  gap: 16px;
}

.dish-period-overview div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dish-period-overview div span {
  font-size: 0.78rem;
  color: #94a3b8;
}

.dish-period-overview div strong {
  font-size: 1.05rem;
  color: #fbbf24;
  font-weight: 700;
}

.dish-period-overview ul {
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
  flex-wrap: wrap;
}

.dish-period-overview ul li {
  font-size: 0.8rem;
  color: #cbd5e1;
}

.dish-period-overview ul li b {
  color: #f1f5f9;
  margin-left: 4px;
  font-size: 0.9rem;
}

/* ECharts Trend Grid */
.dish-category-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  margin-bottom: 20px;
}

.dish-chart-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 12px;
  min-height: 290px !important;
}

.dish-chart-card h4 {
  margin: 0 0 8px;
  color: #e2e8f0;
  font-size: 0.88rem;
  font-weight: 600;
}

.dish-chart {
  height: 245px !important;
  width: 100%;
}

/* Categorical decisions board */
.dish-category-decision-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  margin-bottom: 20px;
}

.dish-decision-col {
  box-sizing: border-box;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 250px;
  max-height: 400px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.012);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.dish-decision-col.stop {
  border-left: 4px solid #ef4444;
}

.dish-decision-col.watch {
  border-left: 4px solid #f59e0b;
}

.dish-decision-col.focus {
  border-left: 4px solid #10b981;
}

.dish-decision-col header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 8px;
  margin-bottom: 4px;
}

.dish-decision-col header .col-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f1f5f9;
}

.dish-decision-col.stop header .col-title {
  color: #fca5a5;
}

.dish-decision-col.watch header .col-title {
  color: #fde047;
}

.dish-decision-col.focus header .col-title {
  color: #86efac;
}

.dish-decision-col header .col-count {
  font-size: 0.8rem;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 10px;
  color: #cbd5e1;
}

.dish-decision-col .col-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

/* Individual decision item card */
.decision-card-item {
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.decision-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.decision-card-header strong {
  font-size: 0.8rem;
  color: #e2e8f0;
}

.decision-badge {
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
}

.decision-card-reason {
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.3;
}

.decision-card-action {
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.3;
}

.dish-decision-col.stop .decision-card-action {
  color: #fca5a5;
}

.dish-decision-col.watch .decision-card-action {
  color: #fde047;
}

.dish-decision-col.focus .decision-card-action {
  color: #86efac;
}

.decision-empty {
  font-size: 0.74rem;
  color: #475569;
  text-align: center;
  padding: 24px 0;
  font-style: italic;
}

/* Rows Layout Flex Grid */
.dish-category-charts-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  margin-bottom: 20px;
}

.dish-chart-card {
  flex: 1;
  min-width: 320px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 12px;
  height: 330px !important; /* Forces equal height for all charts in row */
  display: flex;
  flex-direction: column;
}

.dish-chart-card h4 {
  margin: 0 0 8px;
  color: #e2e8f0;
  font-size: 0.88rem;
  font-weight: 600;
}

.dish-chart {
  height: 275px !important; /* Fits perfectly inside the 330px card */
  width: 100%;
}

.dish-category-decision-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  margin-bottom: 20px;
}

.dish-decision-col {
  flex: 1;
  min-width: 260px;
  box-sizing: border-box;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 380px !important; /* Forces equal height for all decisions in row */
  background: rgba(255, 255, 255, 0.012);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.dish-decision-col.stop {
  border-left: 4px solid #ef4444;
}

.dish-decision-col.watch {
  border-left: 4px solid #f59e0b;
}

.dish-decision-col.focus {
  border-left: 4px solid #10b981;
}

.dish-decision-col header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 8px;
  margin-bottom: 4px;
}

.dish-decision-col header .col-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f1f5f9;
}

.dish-decision-col.stop header .col-title {
  color: #fca5a5;
}

.dish-decision-col.watch header .col-title {
  color: #fde047;
}

.dish-decision-col.focus header .col-title {
  color: #86efac;
}

.dish-decision-col header .col-count {
  font-size: 0.8rem;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 10px;
  color: #cbd5e1;
}

.dish-decision-col .col-body {
  flex: 1;
  overflow-y: auto; /* Content is scrollable inside the fixed height */
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.dish-category-signals-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  margin-bottom: 20px;
}

.dish-signal-card {
  flex: 1;
  min-width: 260px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.015) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 14px !important;
  padding: 12px !important;
  height: 300px !important; /* Forces equal height for all signal cards in row */
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dish-signal-card h4 {
  margin: 0 0 10px !important;
  color: #fbbf24 !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 6px;
}

.dish-signal-card .dish-signal-list {
  flex: 1;
  overflow-y: auto; /* Content is scrollable inside the fixed height */
  padding-right: 4px;
}

.dish-chart-card-empty,
.dish-decision-col-empty,
.dish-signal-card-empty {
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.015);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.88rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px !important;
}

/* =====================================================
   采购分析 · 每日成本占比预警模块 (PDR)
   v3.1.0
   ===================================================== */
.purchase-daily-ratio-section {
  margin-bottom: 16px;
  padding: 16px 18px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}

/* Header */
.pdr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 6px;
}
.pdr-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #e2e8f0;
}
.pdr-header-left .fa-chart-pie { color: #a78bfa; font-size: 1rem; }
.pdr-sales-badge {
  background: rgba(167,139,250,0.15);
  color: #c4b5fd;
  border: 1px solid rgba(167,139,250,0.25);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.72rem;
  font-weight: 700;
}
.pdr-as-of {
  font-size: 0.72rem;
  color: #64748b;
}

/* Category cards row */
.pdr-cards {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.pdr-card {
  min-width: 0;
  border-radius: 12px;
  padding: 11px 13px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  transition: transform 0.15s;
}
.pdr-card:hover { transform: translateY(-2px); }

/* Signal border accent */
.pdr-ok  { border-left: 3px solid #4ade80; }
.pdr-high { border-left: 3px solid #fb7185; background: rgba(251,113,133,0.05); }
.pdr-low  { border-left: 3px solid #fbbf24; background: rgba(251,191,36,0.05); }

.pdr-card-label {
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.pdr-card-amount {
  font-size: 0.88rem;
  font-weight: 800;
  color: #f1f5f9;
}
.pdr-card-ratio {
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
  color: #fbbf24;
}
.pdr-ok  .pdr-card-ratio { color: #4ade80; }
.pdr-high .pdr-card-ratio { color: #fb7185; }
.pdr-low  .pdr-card-ratio { color: #fbbf24; }

.pdr-card-signal {
  font-size: 0.65rem;
  font-weight: 800;
  border-radius: 6px;
  padding: 2px 5px;
  width: fit-content;
}
.pdr-ok  .pdr-card-signal { color: #4ade80; background: rgba(74,222,128,0.12); }
.pdr-high .pdr-card-signal { color: #fb7185; background: rgba(251,113,133,0.14); }
.pdr-low  .pdr-card-signal { color: #fbbf24; background: rgba(251,191,36,0.13); }

.pdr-card-hist {
  font-size: 0.62rem;
  color: #475569;
  line-height: 1.4;
  margin-top: 2px;
}
.pdr-ratio-sub {
  font-size: 0.55rem;
  font-weight: 600;
  color: #64748b;
  margin-left: 3px;
  vertical-align: middle;
}
.pdr-card-month-ratio {
  font-size: 0.63rem;
  color: #64748b;
  margin-top: 1px;
}

@media (max-width: 1500px) {
  .pdr-cards {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .pdr-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* History table */
.pdr-history-head {
  font-size: 0.78rem;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pdr-history-head .fa-clock-rotate-left { color: #64748b; }

.pdr-history-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
}
.pdr-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
}
.pdr-history-table th {
  padding: 7px 12px;
  background: rgba(255,255,255,0.04);
  color: #94a3b8;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.pdr-history-table th:first-child { text-align: left; }
.pdr-history-table td {
  padding: 6px 12px;
  text-align: center;
  color: #cbd5e1;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.pdr-history-table tr:last-child td { border-bottom: none; }
.pdr-history-table tr:hover td { background: rgba(255,255,255,0.03); }
.pdr-cat-cell {
  text-align: left !important;
  font-weight: 700;
  color: #e2e8f0;
  white-space: nowrap;
}
/* Anomaly cell highlights */
.pdr-history-table .pdr-th {
  color: #fb7185;
  font-weight: 800;
}
.pdr-history-table .pdr-tl {
  color: #fbbf24;
  font-weight: 800;
}

/* Income weekday anomaly detector */
#tab-income-analysis #income-weekday-alerts {
  overflow-y: auto !important;
}
#tab-income-analysis .weekday-alert-summary {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.45;
  margin-bottom: 8px;
  border: 1px solid rgba(255,255,255,0.08);
}
#tab-income-analysis .weekday-alert-summary.warn {
  color: #fecdd3;
  background: rgba(251,113,133,0.12);
  border-color: rgba(251,113,133,0.24);
}
#tab-income-analysis .weekday-alert-summary.ok {
  color: #bbf7d0;
  background: rgba(34,197,94,0.10);
  border-color: rgba(34,197,94,0.22);
}
#tab-income-analysis .weekday-alert-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
#tab-income-analysis .weekday-alert-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 9px;
  padding: 8px 9px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
}
#tab-income-analysis .weekday-alert-row.low {
  background: rgba(251,113,133,0.10);
  border-color: rgba(251,113,133,0.22);
}
#tab-income-analysis .weekday-alert-row.high {
  background: rgba(34,197,94,0.09);
  border-color: rgba(34,197,94,0.20);
}
#tab-income-analysis .weekday-alert-head {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
#tab-income-analysis .weekday-alert-head b {
  color: #e2e8f0;
  font-size: 0.78rem !important;
  line-height: 1;
}
#tab-income-analysis .weekday-alert-head span {
  width: fit-content;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 900;
  color: #cbd5e1;
  background: rgba(148,163,184,0.14);
}
#tab-income-analysis .weekday-alert-row.low .weekday-alert-head span {
  color: #fecdd3;
  background: rgba(251,113,133,0.18);
}
#tab-income-analysis .weekday-alert-row.high .weekday-alert-head span {
  color: #bbf7d0;
  background: rgba(34,197,94,0.16);
}
#tab-income-analysis .weekday-alert-main {
  min-width: 0;
}
#tab-income-analysis .weekday-alert-values,
#tab-income-analysis .weekday-alert-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  font-size: 0.68rem;
  line-height: 1.25;
}
#tab-income-analysis .weekday-alert-values span {
  color: #f8fafc;
  font-weight: 900;
}
#tab-income-analysis .weekday-alert-values em,
#tab-income-analysis .weekday-alert-meta em {
  color: rgba(203,213,225,0.62);
  font-style: normal;
  white-space: nowrap;
}
#tab-income-analysis .weekday-alert-track {
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
  margin: 5px 0;
}
#tab-income-analysis .weekday-alert-track i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #94a3b8;
}
#tab-income-analysis .weekday-alert-row.low .weekday-alert-track i { background: linear-gradient(90deg,#fb7185,#f43f5e); }
#tab-income-analysis .weekday-alert-row.high .weekday-alert-track i { background: linear-gradient(90deg,#22c55e,#14b8a6); }
#tab-income-analysis .weekday-alert-meta span {
  color: #cbd5e1;
  font-weight: 900;
}
#tab-income-analysis .weekday-alert-row.low .weekday-alert-meta span { color: #fb7185; }
#tab-income-analysis .weekday-alert-row.high .weekday-alert-meta span { color: #34d399; }

/* Income first-row priority layout */
#tab-income-analysis .analysis-grid.income-priority-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  align-items: stretch !important;
}
#tab-income-analysis .analysis-grid.income-priority-grid .card-block {
  height: auto !important;
  min-height: 440px !important;
  overflow: visible !important;
}
#tab-income-analysis .analysis-grid.income-priority-grid .card-block > div {
  overflow: visible !important;
  max-height: none !important;
}
#tab-income-analysis .analysis-grid.income-priority-grid #income-weekday-alerts {
  overflow: visible !important;
  max-height: none !important;
}
#tab-income-analysis .analysis-grid.income-priority-grid .weekday-alert-list {
  gap: 8px;
}
#tab-income-analysis .analysis-grid.income-priority-grid .weekday-alert-row {
  min-height: 88px;
}
@media (max-width: 1280px) {
  #tab-income-analysis .analysis-grid.income-priority-grid {
    grid-template-columns: 1fr !important;
  }
}

/* v3.1.39: Fix layout overlap, collapse empty space and compact periodic section layout */
#tab-reconciliation-center .reconcile-column:nth-child(3) .recon-section:first-child .recon-section-body {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.45rem !important;
    padding: 0.6rem 0.75rem !important;
}
#tab-reconciliation-center #periodic-supplier-chips {
    flex: none !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: 120px !important;
    margin-bottom: 0.35rem !important;
    padding: 0 !important;
}
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip,
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip.active {
    border-bottom: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
}
#tab-reconciliation-center #periodic-supplier-chips .supplier-chip.active strong {
    color: #60a5fa !important;
}

/* Inventory count */
.inventory-count-shell {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.inventory-count-head,
.inventory-workflow-bar {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.inventory-count-head h2 {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}
.inventory-count-head p {
    color: var(--text-secondary);
    font-size: 0.84rem;
}
.inventory-count-actions {
    display: flex;
    gap: 0.5rem;
}
.inventory-workflow-bar {
    padding: 0.68rem 0.78rem;
    flex-wrap: wrap;
    background: rgba(255,255,255,0.025);
}
.inventory-workflow-bar > div {
    min-width: 220px;
    flex: 1;
}
.inventory-workflow-bar b {
    display: block;
    font-size: 0.88rem;
    margin-bottom: 0.12rem;
}
.inventory-workflow-bar span {
    color: var(--text-secondary);
    font-size: 0.74rem;
}
.inventory-workflow-bar input {
    min-width: 140px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.05);
    color: #fff;
    padding: 0 0.75rem;
}
.inventory-status-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 0.6rem;
}
.inventory-period-panel,
.inventory-month-report {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.72rem 0.85rem;
}
.inventory-period-head,
.inventory-report-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.55rem;
    align-items: center;
}
.inventory-period-head h3,
.inventory-report-head h3 {
    font-size: 0.9rem;
    margin-bottom: 0.08rem;
}
.inventory-period-head p,
.inventory-report-head p {
    color: var(--text-secondary);
    font-size: 0.72rem;
}
.inventory-month-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0.2rem 0 0.58rem;
    width: 100%;
}
.inventory-month-card-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.42rem;
}
.inventory-month-analysis-card {
    border-color: rgba(147,197,253,0.28);
    background: rgba(59,130,246,0.06);
}
.inventory-month-analysis-card::before {
    background: #93c5fd;
}
.inventory-month-analysis-card:hover {
    border-color: rgba(147,197,253,0.72);
}
.inventory-week-cards {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.05rem 0 0.12rem;
    align-items: center;
}
.inventory-month-card {
    min-height: 32px;
    box-sizing: border-box;
}
.inventory-week-card {
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: var(--text-primary);
    border-radius: 999px;
    cursor: pointer;
    text-align: center;
    flex: 0 0 auto;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    width: 258px;
    min-width: 258px;
    height: 102px;
    min-height: 102px;
    box-sizing: border-box;
    padding: 0 0.78rem;
    display: inline-grid;
    grid-template-columns: auto auto auto auto auto;
    align-items: center;
    column-gap: 0.42rem;
    white-space: nowrap;
    color: var(--text-secondary);
}
.inventory-week-card-main { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 2px; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.inventory-card-delete { flex: none; padding: 4px 8px; border: 1px solid rgba(248,113,113,.45); border-radius: 6px; background: transparent; color: #fca5a5; cursor: pointer; }
.inventory-week-card b,
.inventory-week-card strong {
    color: #f8fafc;
    font-size: 0.72rem;
    line-height: 1.15;
}
.inventory-week-card span,
.inventory-week-card em {
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-style: normal;
}
.inventory-week-card::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #64748b;
}
.inventory-week-card.idle::before { background: #64748b; }
.inventory-week-card.warn::before { background: #f59e0b; }
.inventory-week-card.ok::before { background: #22c55e; }
.inventory-week-card.done::before { background: #3b82f6; }
.inventory-week-card.active {
    border-color: #fbbf24;
    background: rgba(251,191,36,0.1);
    color: #fff;
}
.inventory-week-card:hover,
.inventory-week-card:focus-visible {
    border-color: rgba(251,191,36,0.65);
    outline: none;
}
.inventory-week-card:active {
    transform: scale(0.985);
    background: rgba(251,191,36,0.14);
}
.inventory-card-delete {
    position: relative;
    z-index: 2;
    touch-action: manipulation;
}

.inventory-month-report {
    background: rgba(255,255,255,0.025);
}
.inventory-report-kpis {
    display: flex;
    gap: 0.42rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.inventory-report-kpis span {
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.28rem 0.62rem;
    color: var(--text-secondary);
    font-size: 0.68rem;
}
.inventory-report-kpis b {
    color: #fff;
    margin-left: 0.25rem;
}
.inventory-report-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
}
.inventory-report-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    column-gap: 0.45rem;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 0.42rem 0.55rem;
    background: rgba(255,255,255,0.03);
    font-size: 0.7rem;
    min-height: 38px;
}
.inventory-report-row b {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.72rem;
}
.inventory-report-row b small {
    display: block;
    margin-top: 0.16rem;
    color: var(--text-secondary);
    font-size: 0.62rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.inventory-report-row span {
    color: var(--text-secondary);
    display: none;
}
.inventory-report-row em {
    color: #cbd5e1;
    font-style: normal;
    font-weight: 800;
}
.inventory-report-row strong {
    color: #f8fafc;
}
.inventory-status-card .gain,
.inventory-week-card .gain,
.inventory-report-kpis .gain,
.inventory-report-row .gain {
    color: #34d399;
}
.inventory-status-card .loss,
.inventory-week-card .loss,
.inventory-report-kpis .loss,
.inventory-report-row .loss {
    color: #fb7185;
}
.inventory-report-row.gain {
    border-color: rgba(52,211,153,0.18);
    background: rgba(16,185,129,0.045);
}
.inventory-report-row.loss {
    border-color: rgba(251,113,133,0.18);
    background: rgba(239,68,68,0.045);
}
.inventory-status-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.58rem 0.68rem;
    background: rgba(255,255,255,0.025);
}
.inventory-status-card span {
    display: block;
    color: var(--text-secondary);
    font-size: 0.72rem;
    margin-bottom: 0.25rem;
}
.inventory-status-card b {
    font-size: 0.98rem;
}
.inventory-filter-row {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
}
.inventory-filter {
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 0.45rem 0.8rem;
    cursor: pointer;
    white-space: nowrap;
}
.inventory-filter.active {
    color: #fff;
    border-color: rgba(59,130,246,0.5);
    background: rgba(59,130,246,0.16);
}
.inventory-table-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}
.inventory-table-wrap {
    overflow: auto;
}
.inventory-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
}
.inventory-table th,
.inventory-table td {
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 0.55rem 0.65rem;
    text-align: left;
    vertical-align: middle;
    font-size: 0.82rem;
}
.inventory-table th {
    color: var(--text-secondary);
    font-size: 0.72rem;
    background: rgba(255,255,255,0.04);
    position: sticky;
    top: 0;
    z-index: 1;
}
.inventory-table td b {
    display: block;
    font-size: 0.86rem;
}
.inventory-table td small {
    display: block;
    color: var(--text-secondary);
    margin-top: 0.1rem;
}
.inventory-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.inventory-table input {
    width: 100%;
    min-width: 82px;
    height: 34px;
    border-radius: 7px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.18);
    color: #fff;
    padding: 0 0.55rem;
}
.inventory-table input:disabled {
    opacity: 0.65;
}
.inventory-table .gain {
    color: #34d399;
    font-weight: 800;
}
.inventory-table .loss,
.inventory-table .warn {
    color: #fb7185;
    font-weight: 800;
}
.inventory-row-negative_book {
    background: rgba(251,113,133,0.06);
}
.inventory-row-loss {
    background: rgba(239,68,68,0.04);
}
.inventory-row-gain {
    background: rgba(16,185,129,0.04);
}
.inventory-empty {
    text-align: center !important;
    color: var(--text-secondary);
    padding: 2rem !important;
}
.inventory-empty.mini {
    padding: 0.8rem !important;
    width: 100%;
}
@media (max-width: 900px) {
    .inventory-count-head,
    .inventory-workflow-bar {
        align-items: stretch;
        flex-direction: column;
    }
    .inventory-count-actions,
    .inventory-workflow-bar input,
    .inventory-workflow-bar button {
        width: 100%;
    }
    .inventory-status-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .inventory-report-head {
        flex-direction: column;
    }
    .inventory-report-kpis {
        justify-content: flex-start;
    }
    .inventory-report-list {
        grid-template-columns: 1fr;
    }
    .inventory-report-row {
        grid-template-columns: 1fr;
    }
    .inventory-table-card {
        border: 1px solid var(--border-color);
        background: rgba(255,255,255,0.025) !important;
        overflow: hidden;
    }
    .inventory-table-wrap {
        overflow-x: auto;
        scrollbar-width: thin;
    }
    .inventory-table {
        width: calc(100% + 92px);
        min-width: 0;
        table-layout: fixed;
        border-collapse: collapse;
    }
    .inventory-table tr[data-code].inventory-row-negative_book {
        background: rgba(251,113,133,0.08);
    }
    .inventory-table th,
    .inventory-table td {
        border-bottom: 1px solid rgba(255,255,255,0.06);
        padding: 0.38rem 0.18rem;
        min-width: 0;
        box-sizing: border-box;
        height: 38px;
        font-size: 0.72rem;
        line-height: 1.22;
    }
    .inventory-table th {
        top: 0;
        padding-top: 0.32rem;
        padding-bottom: 0.32rem;
        white-space: normal;
        word-break: keep-all;
    }
    .inventory-table th:nth-child(1),
    .inventory-table td:nth-child(1) {
        width: 5.8%;
        text-align: center;
        color: var(--text-secondary);
        font-size: 0.68rem;
    }
    .inventory-table th:nth-child(2),
    .inventory-table td:nth-child(2) {
        width: 29.2%;
    }
    .inventory-table th:nth-child(3),
    .inventory-table td:nth-child(3) {
        width: 6.8%;
        text-align: center;
    }
    .inventory-table th:nth-child(4),
    .inventory-table td:nth-child(4) {
        width: 10.8%;
    }
    .inventory-table th:nth-child(5),
    .inventory-table td:nth-child(5) {
        width: 13.6%;
    }
    .inventory-table th:nth-child(6),
    .inventory-table td:nth-child(6) {
        width: 9.8%;
    }
    .inventory-table th:nth-child(7),
    .inventory-table td:nth-child(7) {
        width: 11.8%;
    }
    .inventory-table th:nth-child(8),
    .inventory-table td:nth-child(8) {
        width: 92px;
    }
    .inventory-table td:nth-child(2) b {
        display: block;
        font-size: 0.74rem;
        line-height: 1.2;
        white-space: normal;
        overflow-wrap: anywhere;
    }
    .inventory-table td:nth-child(2) small {
        display: none;
    }
    .inventory-table .num {
        text-align: right;
    }
    .inventory-table input {
        width: 100%;
        min-width: 0;
        height: 30px;
        border-radius: 6px;
        padding: 0 0.22rem;
        font-size: 0.82rem;
        text-align: center;
    }
    .inventory-table td:nth-child(8) {
        background: rgba(255,255,255,0.025);
    }
    .inventory-table td:nth-child(8) input {
        min-width: 0;
        text-align: left;
    }
}
@media (max-width: 420px) {
    .inventory-table th,
    .inventory-table td {
        padding-left: 0.12rem;
        padding-right: 0.12rem;
        font-size: 0.68rem;
    }
    .inventory-table td:nth-child(2) b {
        font-size: 0.72rem;
    }
    .inventory-table input {
        height: 28px;
        font-size: 0.78rem;
    }
    .inventory-table td:nth-child(8) input {
        min-width: 0;
    }
}

/* =====================================================
   进销管理 (3014 嵌入容器样式)
   ===================================================== */
.inventory-mgmt-shell {
    position: relative;
    width: 100% !important;
    height: calc(100vh - 125px) !important;
    max-height: calc(100vh - 125px) !important;
    border-radius: 12px;
    overflow: hidden !important;
    background: #020617 !important;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.inventory-mgmt-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(2, 6, 23, 0.92);
    z-index: 5;
    gap: 12px;
    color: #94a3b8;
    font-size: 0.9rem;
}

.inventory-mgmt-loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(245, 158, 11, 0.2);
    border-top-color: #f59e0b;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.inventory-mgmt-frame {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    display: block !important;
    background: #020617 !important;
}

@media (max-width: 768px) {
    .inventory-mgmt-shell {
        height: calc(100vh - 105px) !important;
        max-height: calc(100vh - 105px) !important;
        border-radius: 8px;
        border: none;
    }
}

/* =====================================================
   二级业务卡片切换栏 (Sub Navigation Card Tabs)
   ===================================================== */
.sub-nav-bar {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 0 16px 0 !important;
    padding: 4px !important;
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    position: static !important;
    clear: both !important;
}

.sub-nav-pill {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 8px !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #94a3b8 !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    line-height: 40px !important;
    text-decoration: none !important;
    text-align: center !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.sub-nav-pill:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.sub-nav-pill.active {
    color: #ffba08 !important;
    background: rgba(255, 186, 8, 0.22) !important;
    border-color: #ffba08 !important;
    font-weight: 800 !important;
    box-shadow: 0 2px 8px rgba(255, 186, 8, 0.25) !important;
}

.sub-nav-pill span {
    display: inline-block !important;
    white-space: nowrap !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: inherit !important;
}

@media (max-width: 768px) {
    .sub-nav-bar {
        position: static !important;
        width: 100% !important;
        display: flex !important;
        padding: 4px !important;
        margin: 0 0 14px 0 !important;
        border-radius: 8px !important;
        gap: 4px !important;
        background: #0f172a !important;
    }
    .sub-nav-pill {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        height: 38px !important;
        min-height: 38px !important;
        padding: 0 4px !important;
        font-size: 13.5px !important;
        border-radius: 6px !important;
        text-align: center !important;
    }
    .sub-nav-pill span {
        font-size: 13.5px !important;
        font-weight: 700 !important;
        white-space: nowrap !important;
    }
}

/* v1.7.0: Monthly Reconciliation Audit & Split by Month */
.prepaid-head-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.prepaid-month-selector {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(0, 0, 0, 0.25);
    padding: 3px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.prepaid-month-chip {
    border: 1px solid transparent;
    background: transparent;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.prepaid-month-chip:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.prepaid-month-chip.active {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(59, 130, 246, 0.35));
    border-color: rgba(96, 165, 250, 0.5);
    color: #93c5fd;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.prepaid-audit-badge-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.prepaid-audit-summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.65rem 0.9rem;
    margin-bottom: 0.85rem;
    overflow-x: auto;
}

.audit-stat-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.audit-stat-group.highlight {
    background: rgba(255, 255, 255, 0.04);
    padding: 3px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.audit-stat-label {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
}

.audit-stat-val {
    font-size: 0.82rem;
    color: #f1f5f9;
    font-weight: 700;
    white-space: nowrap;
}

.audit-stat-op {
    font-size: 0.85rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.35);
    flex-shrink: 0;
}

.audit-stat-vs {
    font-size: 0.72rem;
    font-weight: 700;
    color: #60a5fa;
    text-transform: uppercase;
    flex-shrink: 0;
}

.audit-stat-sep {
    font-size: 0.95rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
    padding: 0 2px;
}

.audit-stat-note {
    width: 100%;
    margin-top: 6px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
    flex-basis: 100%;
}

.audit-stat-diff-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.3);
    padding: 4px 10px;
    border-radius: 8px;
    flex-shrink: 0;
}

.audit-stat-diff-box.has-diff {
    background: rgba(244, 63, 94, 0.12);
    border-color: rgba(251, 113, 133, 0.4);
}

.audit-stat-diff {
    font-size: 0.82rem;
    color: #34d399;
    font-weight: 800;
    white-space: nowrap;
}

.audit-stat-diff-box.has-diff .audit-stat-diff {
    color: #fb7185;
}

.prepaid-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.65rem;
    gap: 0.5rem;
}

.prepaid-card-head h4 {
    margin: 0;
}

.prepaid-card-subtotal {
    font-size: 0.7rem;
    color: #fbbf24;
    font-weight: 600;
}

.daily-audit-badge {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
}

.daily-audit-badge.pass {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.daily-audit-badge.fail {
    background: rgba(244, 63, 94, 0.15);
    color: #fb7185;
    border: 1px solid rgba(251, 113, 133, 0.3);
}

@media (max-width: 900px) {
    .prepaid-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }
    .prepaid-audit-summary-bar {
        padding: 0.5rem;
        gap: 0.3rem;
    }
}

/* ============================================================
   盈亏分析 2026-08+ 新版双栏比对与一键快照布局
   ============================================================ */
.profit-modern-shell {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.profit-modern-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.profit-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
}

.profit-status-badge.badge-locked {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.profit-status-badge.badge-live {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.35);
}

.profit-split-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.95fr);
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 1200px) {
    .profit-split-layout {
        grid-template-columns: 1fr;
    }
}

.profit-main-column {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
}

.profit-snapshot-column {
    position: sticky;
    top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profit-snapshot-card {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(56, 189, 248, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    border-radius: 14px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.profit-snapshot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0.75rem;
}

.profit-snapshot-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #38bdf8;
    margin: 0;
}

.profit-snapshot-time {
    font-size: 0.76rem;
    color: #94a3b8;
}

.profit-snapshot-preview-box {
    width: 100%;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profit-snapshot-preview-box:hover {
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.2);
}

.profit-snapshot-preview-box img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    border-radius: 8px;
}

.profit-snapshot-hover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #38bdf8;
    font-size: 0.88rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.2s;
}

.profit-snapshot-preview-box:hover .profit-snapshot-hover-overlay {
    opacity: 1;
}

.profit-snapshot-empty-box {
    padding: 2.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.75rem;
    color: #94a3b8;
}

.profit-snapshot-actions {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    justify-content: flex-end;
}

/* 锁定只读态下表单输入框样式 */
.profit-locked-readonly input[data-profit-key] {
    background: rgba(255, 255, 255, 0.02) !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
    color: #cbd5e1 !important;
    cursor: not-allowed !important;
}

.profit-locked-readonly .btn-ocr-input-trigger,
.profit-locked-readonly #btn-import-dine-in {
    display: none !important;
}

/* 快照大图模态框 */
.snapshot-lightbox-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.snapshot-lightbox-content {
    position: relative;
    max-width: 92vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.snapshot-lightbox-content img {
    max-width: 100%;
    max-height: 84vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.snapshot-lightbox-close {
    position: absolute;
    top: -15px;
    right: -15px;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* ============ v3.2.0.160 差距明细表 + 四模块交叉佐证 ============ */
.recon-gap-table,
.cross-check-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.72rem;
    color: #e2e8f0;
}
.recon-gap-table th,
.recon-gap-table td {
    padding: 4px 8px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    line-height: 1.35;
}
.recon-gap-table thead th {
    color: var(--text-secondary, #94a3b8);
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}
.recon-gap-table .num,
.cross-check-table .num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.recon-gap-table .basis {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.68rem;
}
.recon-gap-table tr.recon-gap-group td {
    background: rgba(255, 255, 255, 0.045);
    font-weight: 800;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.recon-gap-table tr.recon-gap-item td:first-child {
    padding-left: 16px;
    color: rgba(255, 255, 255, 0.72);
}
.recon-gap-table tr.recon-gap-total td {
    background: rgba(56, 189, 248, 0.1);
    font-weight: 800;
    border-top: 2px solid rgba(255, 255, 255, 0.25);
    font-size: 0.76rem;
}

.cross-check-body {
    font-size: 0.8rem;
    color: #cbd5e1;
}
.cross-check-lead {
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 10px;
    line-height: 1.45;
}
.cross-check-table th,
.cross-check-table td {
    padding: 7px 9px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.cross-check-table thead th {
    color: var(--text-secondary, #94a3b8);
    font-weight: 600;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}
.cross-check-table .cc-metric {
    font-weight: 700;
    color: #f1f5f9;
}
.cross-check-table .cc-source {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.42);
    margin-top: 2px;
}
.cross-check-table .cc-note {
    font-size: 0.7rem;
    color: #fbbf24;
    margin-top: 3px;
}
.cross-check-table .cc-authority {
    font-size: 0.7rem;
    color: #38bdf8;
    white-space: nowrap;
}
.cross-check-table .cc-baseline {
    font-weight: 800;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
}
.cross-check-table .cc-prov {
    font-size: 0.66rem;
    color: rgba(148, 197, 255, 0.7);
    margin-top: 3px;
}
.cross-check-table .cc-prov .cc-file {
    color: #93c5fd;
}
.cross-check-table .cc-source code {
    font-size: 0.66rem;
    background: rgba(255, 255, 255, 0.06);
    padding: 0 4px;
    border-radius: 3px;
    color: rgba(255, 255, 255, 0.55);
}

/* 3014 iframe 嵌入态：目标 tab 没有 .active 类，必须由目标面板本身接管纵向滚动。 */
html.embed-mode .main-content {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
}
html.embed-reconciliation #tab-reconciliation-center,
html.embed-inventory-count #tab-inventory-count {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* ============ 首页经营驾驶舱 (cockpit) — 只加不改，沿用现有 token / 卡片风格 ============ */
#cockpit-mount { display: flex; flex-direction: column; gap: .7rem; margin-bottom: .85rem; }
#cockpit-mount .ck-loading-shell { min-height: 104px; padding: .9rem 1rem; border: 1px solid rgba(96,165,250,.24); border-radius: 14px; background: linear-gradient(115deg, rgba(96,165,250,.1), rgba(15,23,42,.78) 48%, rgba(52,211,153,.06)); display: flex; flex-direction: column; gap: .52rem; }
#cockpit-mount .ck-loading-title { display: flex; align-items: center; gap: .55rem; color: var(--text-primary); font-size: .88rem; }
#cockpit-mount .ck-loading-title i { width: .55rem; height: .55rem; border-radius: 50%; background: #60a5fa; box-shadow: 0 0 0 5px rgba(96,165,250,.12); animation: ck-loading-pulse 1.1s ease-in-out infinite; }
#cockpit-mount .ck-loading-shell > span { color: var(--text-secondary); font-size: .73rem; }
#cockpit-mount .ck-loading-lines { display: flex; gap: .45rem; margin-top: .1rem; }
#cockpit-mount .ck-loading-lines b { display: block; height: .42rem; flex: 1; border-radius: 999px; background: linear-gradient(90deg, rgba(148,163,184,.12), rgba(96,165,250,.36), rgba(148,163,184,.12)); background-size: 200% 100%; animation: ck-loading-shimmer 1.2s linear infinite; }
#cockpit-mount .ck-loading-lines b:nth-child(2) { animation-delay: .14s; }
#cockpit-mount .ck-loading-lines b:nth-child(3) { animation-delay: .28s; }
@keyframes ck-loading-pulse { 50% { opacity: .45; transform: scale(.82); } }
@keyframes ck-loading-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* 通用骨架屏占位条：首页 mini 卡在数据到达前显示"加载中的形状"而不是空白/￥0.00，
   避免第一帧看起来像"另一个更简陋的旧页面"，再被数据"替换掉"的割裂感。 */
.skel-lines { display: flex; flex-direction: column; gap: .32rem; padding: .15rem 0; }
.skel-lines b { display: block; height: .5rem; border-radius: 999px; background: linear-gradient(90deg, rgba(148,163,184,.1), rgba(148,163,184,.28), rgba(148,163,184,.1)); background-size: 200% 100%; animation: ck-loading-shimmer 1.3s linear infinite; }
.skel-lines b:nth-child(1) { width: 78%; }
.skel-lines b:nth-child(2) { width: 55%; animation-delay: .15s; }
.skel-lines b:nth-child(3) { width: 66%; animation-delay: .3s; }
.skel-amount { display: inline-block; width: 4.2rem; height: .95rem; border-radius: 999px; background: linear-gradient(90deg, rgba(148,163,184,.12), rgba(251,191,36,.28), rgba(148,163,184,.12)); background-size: 200% 100%; animation: ck-loading-shimmer 1.3s linear infinite; vertical-align: middle; }
#cockpit-mount .ck-sec { display: flex; flex-direction: column; gap: .6rem; }
#cockpit-mount .ck-sec-h { display: flex; align-items: baseline; gap: .6rem; }
#cockpit-mount .ck-sec-h .t { font-family: var(--font-heading); font-size: .8rem; font-weight: 800; letter-spacing: .06em; color: var(--text-primary); }
#cockpit-mount .ck-sec-h .d { flex: 1; height: 1px; background: rgba(255,255,255,.08); }
#cockpit-mount .ck-sec-h .n { font-size: .68rem; color: var(--text-secondary); }

#cockpit-mount .ck-verdict { padding: .85rem 1rem; border-radius: 14px; border: 1px solid rgba(96,165,250,.22);
  background: linear-gradient(135deg, rgba(96,165,250,.12), rgba(52,211,153,.06)); font-size: .92rem; line-height: 1.6; color: var(--text-primary); }
#cockpit-mount .ck-verdict .pos { color: #34d399; font-weight: 800; }
#cockpit-mount .ck-verdict .neg { color: #fb7185; font-weight: 800; }

#cockpit-mount .ck-data-health { overflow: hidden; border: 1px solid rgba(52,211,153,.22); border-radius: 14px; background: rgba(15,23,42,.72); }
#cockpit-mount .ck-data-health.warn { border-color: rgba(251,191,36,.32); background: linear-gradient(110deg,rgba(251,191,36,.07),rgba(15,23,42,.76) 42%); }
#cockpit-mount .ck-data-health.danger { border-color: rgba(251,113,133,.38); background: linear-gradient(110deg,rgba(251,113,133,.09),rgba(15,23,42,.78) 42%); }
#cockpit-mount .ck-dh-summary { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.78rem 1rem; }
#cockpit-mount .ck-dh-signal { display:flex; align-items:center; gap:.7rem; min-width:0; }
#cockpit-mount .ck-dh-signal > i { width:.65rem; height:.65rem; flex:0 0 auto; border-radius:50%; background:#34d399; box-shadow:0 0 0 5px rgba(52,211,153,.1),0 0 16px rgba(52,211,153,.35); }
#cockpit-mount .ck-data-health.warn .ck-dh-signal > i { background:#fbbf24; box-shadow:0 0 0 5px rgba(251,191,36,.1),0 0 16px rgba(251,191,36,.35); }
#cockpit-mount .ck-data-health.danger .ck-dh-signal > i { background:#fb7185; box-shadow:0 0 0 5px rgba(251,113,133,.1),0 0 16px rgba(251,113,133,.38); }
#cockpit-mount .ck-dh-signal > span { display:flex; flex-direction:column; gap:.15rem; min-width:0; }
#cockpit-mount .ck-dh-signal b { color:var(--text-primary); font-size:.86rem; }
#cockpit-mount .ck-dh-signal small { color:var(--text-secondary); font-size:.68rem; white-space:normal; }
#cockpit-mount .ck-dh-counts { display:flex; align-items:center; justify-content:flex-end; gap:.38rem; flex-wrap:wrap; }
#cockpit-mount .ck-dh-counts em { padding:.16rem .42rem; border-radius:5px; font-size:.63rem; font-style:normal; font-weight:800; white-space:nowrap; }
#cockpit-mount .ck-dh-counts em.ok { color:#34d399; background:rgba(52,211,153,.1); }
#cockpit-mount .ck-dh-counts em.warn { color:#fbbf24; background:rgba(251,191,36,.11); }
#cockpit-mount .ck-dh-counts em.danger { color:#fb7185; background:rgba(251,113,133,.12); }
#cockpit-mount .ck-dh-arrow { color:var(--text-secondary); font-size:.66rem; margin-left:.2rem; }
#cockpit-mount .ck-dh-arrow::before { content:"\25be  "; }
#cockpit-mount .ck-dh-body { border-top:1px solid rgba(255,255,255,.07); padding:.72rem 1rem .85rem; }
#cockpit-mount .ck-dh-urgent { display:grid; grid-template-columns:5.4rem minmax(0,1fr); gap:.65rem; align-items:start; margin:0 0 .7rem; padding:.68rem .72rem; border:1px solid rgba(251,113,133,.2); border-radius:10px; background:rgba(251,113,133,.065); }
#cockpit-mount .ck-dh-urgent > span { padding-top:.1rem; color:#fda4af; font-size:.76rem; font-weight:800; white-space:nowrap; }
#cockpit-mount .ck-dh-urgent > div { display:flex; flex-direction:column; gap:.36rem; min-width:0; }
#cockpit-mount .ck-dh-urgent-item { display:flex; align-items:baseline; flex-wrap:wrap; gap:.38rem; font-size:.8rem; line-height:1.45; }
#cockpit-mount .ck-dh-urgent-item b { color:#fda4af; font-size:.84rem; }
#cockpit-mount .ck-dh-urgent-item span { color:var(--text-primary); }
#cockpit-mount .ck-dh-urgent-item.warn b { color:#fcd34d; }
#cockpit-mount .ck-dh-urgent-item.ok b { color:#6ee7b7; }
#cockpit-mount .ck-data-health.warn .ck-dh-urgent { border-color:rgba(251,191,36,.2); background:rgba(251,191,36,.06); }
#cockpit-mount .ck-dh-toolbar { display:flex; align-items:center; justify-content:space-between; gap:.75rem; padding:0 0 .45rem; color:var(--text-secondary); font-size:.67rem; }
#cockpit-mount .ck-dh-refresh,#cockpit-mount .ck-dh-go { appearance:none; border:1px solid rgba(148,163,184,.22); border-radius:7px; background:rgba(255,255,255,.045); color:var(--text-secondary); font:inherit; cursor:pointer; transition:border-color .18s ease,color .18s ease,background .18s ease; }
#cockpit-mount .ck-dh-refresh { padding:.3rem .55rem; }
#cockpit-mount .ck-dh-go { align-self:center; padding:.28rem .55rem; white-space:nowrap; }
#cockpit-mount .ck-dh-refresh:hover,#cockpit-mount .ck-dh-go:hover { color:var(--text-primary); border-color:rgba(96,165,250,.48); background:rgba(96,165,250,.08); }
#cockpit-mount .ck-dh-refresh:disabled { opacity:.65; cursor:wait; }
#cockpit-mount .ck-dh-list { display:flex; flex-direction:column; }
#cockpit-mount .ck-dh-row { display:grid; grid-template-columns:.55rem minmax(0,1fr) auto; align-items:start; gap:.65rem; padding:.58rem .1rem; border-top:1px solid rgba(255,255,255,.055); }
#cockpit-mount .ck-dh-row:first-child { border-top:0; }
#cockpit-mount .ck-dh-dot { width:.42rem; height:.42rem; margin-top:.32rem; border-radius:2px; background:#fb7185; }
#cockpit-mount .ck-dh-row.warn .ck-dh-dot { background:#fbbf24; }
#cockpit-mount .ck-dh-row.ok .ck-dh-dot { background:#34d399; }
#cockpit-mount .ck-dh-copy { min-width:0; }
#cockpit-mount .ck-dh-line { display:flex; align-items:center; gap:.5rem; }
#cockpit-mount .ck-dh-line strong { color:var(--text-primary); font-size:.76rem; }
#cockpit-mount .ck-dh-line span { color:var(--text-secondary); font-size:.61rem; }
#cockpit-mount .ck-dh-copy p { margin:.14rem 0 0; color:var(--text-secondary); font-size:.72rem; line-height:1.45; }
#cockpit-mount .ck-dh-copy small { display:block; margin-top:.1rem; color:rgba(148,163,184,.72); font-size:.65rem; }
#cockpit-mount .ck-dh-more { margin-top:.4rem; padding:.5rem .65rem; border-radius:8px; background:rgba(255,255,255,.035); color:var(--text-secondary); font-size:.68rem; }

/* 全绿时压成一行：无"当前需要处理"空框，明细默认折叠 */
#cockpit-mount .ck-data-health.ck-dh-slim { background:rgba(15,23,42,.55); }
#cockpit-mount .ck-dh-slim .ck-dh-summary { padding:.6rem .9rem; }
#cockpit-mount .ck-dh-slim-actions { display:flex; align-items:center; gap:.4rem; flex:0 0 auto; }
#cockpit-mount .ck-dh-toggle { appearance:none; border:1px solid rgba(148,163,184,.22); border-radius:7px; background:rgba(255,255,255,.045); color:var(--text-secondary); font:inherit; font-size:.67rem; padding:.3rem .6rem; cursor:pointer; transition:border-color .18s ease,color .18s ease,background .18s ease; }
#cockpit-mount .ck-dh-toggle:hover { color:var(--text-primary); border-color:rgba(96,165,250,.48); background:rgba(96,165,250,.08); }
#cockpit-mount .ck-dh-slim .ck-dh-body { padding:.2rem 1rem .6rem; }
#cockpit-mount .ck-dh-slim .ck-dh-row { padding:.42rem .1rem; }
#cockpit-mount .ck-dh-slim .ck-dh-copy p { margin-top:.06rem; font-size:.66rem; }
@media (max-width: 720px) {
  #cockpit-mount .ck-dh-slim-actions { width:100%; justify-content:flex-start; }
}

#cockpit-mount .ck-spine { display: grid; grid-template-columns: 1.5fr 1fr; gap: .7rem; }
#cockpit-mount .ck-wf { display: flex; flex-direction: column; }
#cockpit-mount .ck-wf .row { display: grid; grid-template-columns: 8.5rem 1fr 6.5rem; align-items: center; gap: .6rem; padding: .38rem 0; font-size: .8rem; }
#cockpit-mount .ck-wf .row .lab { color: var(--text-secondary); }
#cockpit-mount .ck-wf .row.total .lab, #cockpit-mount .ck-wf .row.subtotal .lab { color: var(--text-primary); font-weight: 800; }
#cockpit-mount .ck-wf .row.subtotal { border-top: 1px dashed rgba(255,255,255,.16); border-bottom: 1px dashed rgba(255,255,255,.16); margin: .2rem 0; }
#cockpit-mount .ck-wf .row.total { border-top: 1px solid rgba(255,255,255,.22); margin-top: .2rem; }
#cockpit-mount .ck-wf .barwrap { position: relative; height: 1.1rem; background: linear-gradient(rgba(255,255,255,.08),rgba(255,255,255,.08)) center/100% 1px no-repeat; }
#cockpit-mount .ck-wf .bar { position: absolute; top: .18rem; height: .74rem; border-radius: 2px; }
#cockpit-mount .ck-wf .bar.inc { background: rgba(148,163,184,.6); }
#cockpit-mount .ck-wf .bar.dec { background: rgba(251,113,133,.8); }
#cockpit-mount .ck-wf .bar.start { background: rgba(96,165,250,.85); }
#cockpit-mount .ck-wf .bar.sub { background: rgba(251,191,36,.4); }
#cockpit-mount .ck-wf .delta { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); font-size: .76rem; color: var(--text-secondary); }
#cockpit-mount .ck-wf .delta.neg { color: #fb7185; }
#cockpit-mount .ck-wf .row.total .delta { font-size: 1rem; font-weight: 800; }
#cockpit-mount .ck-wf .note { grid-column: 2 / -1; font-size: .68rem; color: #fbbf24; margin-top: -.15rem; }

#cockpit-mount .ck-health { display: flex; flex-direction: column; gap: .7rem; }
#cockpit-mount .ck-health .hr .top { display: flex; justify-content: space-between; font-size: .78rem; margin-bottom: .3rem; }
#cockpit-mount .ck-health .hr .top .hl { color: var(--text-secondary); }
#cockpit-mount .ck-health .hr .top .hv { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-primary); }
#cockpit-mount .ck-health .hr .top .hv.over { color: #fb7185; }
#cockpit-mount .ck-health .hr .track { position: relative; height: .5rem; background: rgba(255,255,255,.06); border-radius: 4px; }
#cockpit-mount .ck-health .hr .fill { position: absolute; left: 0; top: 0; height: 100%; border-radius: 4px; background: #34d399; }
#cockpit-mount .ck-health .hr .fill.over { background: #fb7185; }
#cockpit-mount .ck-health .hr .fill.warn { background: #fbbf24; }
#cockpit-mount .ck-health .hr .mark { position: absolute; top: -.18rem; width: 2px; height: .86rem; background: var(--text-primary); border-radius: 1px; }

#cockpit-mount .ck-cards3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .7rem; }
#cockpit-mount .ck-card .cap { font-size: .78rem; color: var(--text-secondary); display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
#cockpit-mount .ck-card .big { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 1.32rem; font-weight: 900; margin: .4rem 0 .15rem; }
#cockpit-mount .ck-card .big.pos { color: #34d399; }
#cockpit-mount .ck-card .big.neg { color: #fb7185; }
#cockpit-mount .ck-card .kv { display: flex; justify-content: space-between; font-size: .76rem; color: var(--text-secondary); padding: .22rem 0; border-top: 1px dashed rgba(255,255,255,.07); }
#cockpit-mount .ck-card .kv:first-of-type { border-top: 0; margin-top: .3rem; }
#cockpit-mount .ck-card .kv .v { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-primary); }
#cockpit-mount .ck-card .kv .v.neg { color: #fb7185; }
#cockpit-mount .ck-card .kv .v.pos { color: #34d399; }

#cockpit-mount table.ck-scm { width: 100%; border-collapse: collapse; font-size: .76rem; min-width: 620px; }
#cockpit-mount table.ck-scm th { text-align: right; font-weight: 600; color: var(--text-secondary); font-size: .68rem; padding: .35rem .55rem; border-bottom: 1px solid rgba(255,255,255,.12); white-space: nowrap; }
#cockpit-mount table.ck-scm th:first-child, #cockpit-mount table.ck-scm td:first-child { text-align: left; }
#cockpit-mount table.ck-scm td { text-align: right; padding: .45rem .55rem; border-bottom: 1px solid rgba(255,255,255,.06); color: var(--text-primary); white-space: nowrap; font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
#cockpit-mount table.ck-scm td:first-child { font-family: var(--font-body); }
#cockpit-mount table.ck-scm tr:last-child td { border-bottom: 0; }
#cockpit-mount table.ck-scm .dim { color: var(--text-secondary); }
#cockpit-mount table.ck-scm .badc { color: #fb7185; font-weight: 700; }
#cockpit-mount .ck-scm-wrap { overflow-x: auto; }

#cockpit-mount .ck-radar { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .7rem; }
#cockpit-mount .ck-rc h4 { margin: 0 0 .5rem; font-size: .78rem; color: var(--text-primary); font-weight: 800; }
#cockpit-mount .ck-rc .rl { display: flex; justify-content: space-between; gap: .5rem; font-size: .76rem; padding: .24rem 0; border-top: 1px solid rgba(255,255,255,.06); color: var(--text-secondary); }
#cockpit-mount .ck-rc .rl:first-of-type { border-top: 0; }
#cockpit-mount .ck-rc .rl .rv { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-primary); text-align: right; }
#cockpit-mount .ck-rc .rl .rv.up { color: #fb7185; }
#cockpit-mount .ck-rc .rl .rv.down { color: #34d399; }

#cockpit-mount .ck-focus { display: flex; flex-direction: column; }
#cockpit-mount .ck-focus .fr { display: grid; grid-template-columns: auto 1fr; gap: .6rem; align-items: center; padding: .55rem .2rem; border-top: 1px solid rgba(255,255,255,.06); font-size: .8rem; }
#cockpit-mount .ck-focus .fr:first-child { border-top: 0; }
#cockpit-mount .ck-focus .fr .sev { font-size: .64rem; font-weight: 800; letter-spacing: .04em; padding: .1rem .4rem; border-radius: 5px; white-space: nowrap; }
#cockpit-mount .ck-focus .fr .sev.hi { color: #fb7185; background: rgba(251,113,133,.14); }
#cockpit-mount .ck-focus .fr .sev.md { color: #fbbf24; background: rgba(251,191,36,.14); }
#cockpit-mount .ck-focus .fr .txt { color: var(--text-secondary); }
#cockpit-mount .ck-focus .fr .txt b { color: var(--text-primary); }
#cockpit-mount details.ck-zone > summary { cursor: pointer; list-style: none; }
#cockpit-mount details.ck-zone > summary::-webkit-details-marker { display: none; }
#cockpit-mount details.ck-zone > summary .n::before { content: "\25be  "; }
#cockpit-mount details.ck-zone:not([open]) > summary .n::before { content: "\25b8  "; }
#cockpit-mount .ck-empty { font-size: .78rem; color: var(--text-secondary); padding: .4rem 0; }

@media (max-width: 1100px) {
  #cockpit-mount .ck-spine { grid-template-columns: 1fr; }
  #cockpit-mount .ck-cards3, #cockpit-mount .ck-radar { grid-template-columns: 1fr; }
  #cockpit-mount .ck-dh-summary { align-items:flex-start; flex-direction:column; }
  #cockpit-mount .ck-dh-urgent { grid-template-columns:1fr; gap:.35rem; }
  #cockpit-mount .ck-dh-counts { justify-content:flex-start; }
}

@media (max-width: 640px) {
  #cockpit-mount .ck-dh-body { padding:.65rem .75rem .75rem; }
  #cockpit-mount .ck-dh-toolbar { align-items:flex-start; }
  #cockpit-mount .ck-dh-row { grid-template-columns:.5rem minmax(0,1fr); }
  #cockpit-mount .ck-dh-go { grid-column:2; justify-self:start; }
}

/* v3.2.0.261: mobile analysis pages share one stable vertical scroll model. */
@media (max-width: 768px) {
  /* Profit: months stay on one rail; state and actions remain inside the card. */
  #tab-profit-analysis .profit-month-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    overflow: hidden !important;
  }
  #tab-profit-analysis #profit-month-chips {
    width: 100% !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding-bottom: .25rem !important;
    scrollbar-width: thin;
  }
  #tab-profit-analysis #profit-month-chips .analysis-month-chip {
    flex: 0 0 auto !important;
    min-width: 68px !important;
  }
  #tab-profit-analysis .profit-month-tools {
    width: 100% !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
    flex-wrap: wrap !important;
  }
  #tab-profit-analysis .profit-ledger-status {
    width: 100% !important;
    min-width: 0 !important;
    justify-content: center !important;
    white-space: normal !important;
    text-align: center !important;
  }
  #tab-profit-analysis .profit-month-tools > button {
    flex: 1 1 calc(33.333% - .35rem) !important;
    min-width: 0 !important;
    padding-inline: .55rem !important;
  }
  #tab-profit-analysis #btn-save-profit {
    min-width: 0 !important;
    padding-inline: .55rem !important;
    font-size: .9rem !important;
  }
  #tab-profit-analysis #profit-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  #tab-profit-analysis #profit-kpis .cockpit-kpi {
    min-width: 0 !important;
  }
  #tab-profit-analysis #profit-kpis .cockpit-kpi b {
    max-width: 100% !important;
    font-size: 1rem !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Income: let the four-column actual-cash ledger shrink to the phone card. */
  #tab-income-analysis .income-real-cash-summary {
    grid-template-columns: 1fr !important;
  }
  #tab-income-analysis .income-real-cash-row {
    grid-template-columns: minmax(92px, 1.35fr) repeat(2, minmax(62px, .9fr)) minmax(52px, .7fr) !important;
    gap: .25rem !important;
    font-size: .68rem !important;
  }
  #tab-income-analysis .income-real-cash-row.head {
    font-size: .62rem !important;
  }
  #tab-income-analysis .income-real-cash-row > * {
    min-width: 0 !important;
  }

  /* Online: date query and the three reconciliation panels stay in bounds. */
  #tab-online-analysis .analysis-month-toolbar,
  #tab-online-analysis .platform-view-container,
  #tab-online-analysis #online-reconcile-container {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  #tab-online-analysis #online-custom-start,
  #tab-online-analysis #online-custom-end {
    width: 100% !important;
    min-width: 0 !important;
    padding-inline: .35rem !important;
  }
  #tab-online-analysis .online-scope-controls {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  #tab-online-analysis .online-custom-date-row {
    width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr) auto !important;
    gap: .4rem !important;
  }
  #tab-online-analysis #btn-apply-custom-date {
    flex: 0 0 auto !important;
    padding-inline: .6rem !important;
  }
  #tab-online-analysis #online-reconcile-container > div:first-child > div {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: .65rem !important;
  }
  #tab-online-analysis #online-reconcile-container > div:nth-child(2) {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  #tab-online-analysis #online-reconcile-container > div:nth-child(2) > div,
  #tab-online-analysis #online-reconcile-container > div:nth-child(2) > div * {
    min-width: 0 !important;
  }

  /* Dish sales: remove the clipped inner flex viewport and use the tab scroll. */
  #tab-dish-sales.active,
  #tab-dish-sales-trend.active,
  #tab-dish-sales-catalog.active {
    display: block !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
  }
  #tab-dish-sales .dish-sales-shell,
  #tab-dish-sales-trend .dish-sales-shell,
  #tab-dish-sales-catalog .dish-catalog-shell {
    height: auto !important;
    min-height: 100% !important;
    overflow: visible !important;
  }
  #tab-dish-sales-trend .dish-mom-analysis-section,
  #tab-dish-sales-trend .dish-mom-analysis-section > .recon-section-body {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  /* Monthly report: only wide data tables may scroll sideways. */
  #tab-deep-cost .deep-cost-shell {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
  }
  #tab-deep-cost .deep-cost-report,
  #tab-deep-cost .boss-cockpit,
  #tab-deep-cost .boss-cockpit > *,
  #tab-deep-cost .boss-details,
  #tab-deep-cost .deep-chart-grid,
  #tab-deep-cost .deep-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  #tab-deep-cost .deep-table-wrap {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overscroll-behavior-x: contain;
  }
}
