:root {
    --primary-color: #2DCCD3; /* Pantone 319 C Turquoise */
    --primary-hover: #1FA3A9;
    --bg-light: #f3fbfc;      /* Extremely subtle turquoise tint */
    --bg-card: #ffffff;
    --text-main: #1f2937;
    --text-muted: #64748b;
    --accent: #ebfbfc;       /* Soft Turquoise Accent */
    --success: #10b981;       /* Standard green for successful statuses */
    --warning: #f59e0b;
    --danger: #ef4444;
    --glass-border: rgba(45, 204, 211, 0.15);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.03);

    /* --- PROFESSIONAL TYPE SCALE (Strict Hierarchical System) --- */
    --font-size-h1: 1.35rem;     /* ~21.6px - Page & Modal Main Headers */
    --font-size-h2: 1.15rem;     /* ~18.4px - Card & Section Headers */
    --font-size-label: 1.15rem;  /* ~18.4px - Form Field Labels (Same size as card headers) */
    --font-size-input: 1.15rem;  /* ~18.4px - Input text, options, triggers */
    --font-size-sub: 0.9rem;     /* ~14.4px - Sub-labels and English descriptions */
    --font-size-tiny: 0.75rem;   /* ~12px - Badges and small subtext */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

/* ===================================================
   方案四：统一筛选搜索栏 (Stripe/金融后台风格)
   适配：用户端 & 管理端 | 手机 & PC
   =================================================== */

/* 外层容器 */
.filter-bar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
    width: 100%;
}

/* 第一行：搜索框 + 控件 */
.filter-bar-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 0.5rem 0.8rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    width: 100%;
    box-sizing: border-box;
}

/* 搜索图标+输入框 */
.filter-bar-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}
.filter-bar-search-icon {
    font-size: 0.9rem;
    color: #bbb;
    flex-shrink: 0;
}
.filter-bar-search input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.9rem;
    color: #333;
    width: 100%;
    font-family: inherit;
}
.filter-bar-search input::placeholder { color: #bbb; }

/* 竖线分隔符 */
.filter-bar-divider {
    width: 1px;
    height: 1.2rem;
    background: #e8e8e8;
    flex-shrink: 0;
}

/* Select 控件（年/月） */
.filter-bar-select {
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.82rem;
    font-weight: 600;
    color: #444;
    cursor: pointer;
    padding: 0 0.2rem;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23bbb'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 2px center;
    padding-right: 14px;
}
.filter-bar-select:focus { color: var(--primary-color); }

/* 筛选切换按钮 */
.filter-bar-toggle {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    border: none;
    background: transparent;
    color: #666;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    border-radius: 8px;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
    flex-shrink: 0;
}
.filter-bar-toggle:hover { background: #f5f5f5; }
.filter-bar-toggle.active { background: #ebfbfc; color: #078e93; }

/* 活跃筛选徽章 */
.filter-bar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #2DCCD3;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
}
.filter-bar-badge:empty, .filter-bar-badge[data-count="0"] { display: none; }

/* 展开的高级筛选行 */
.filter-bar-expand {
    display: none;
    flex-wrap: wrap;
    gap: 0.5rem;
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 0.7rem 0.9rem;
    box-sizing: border-box;
    animation: filterExpand 0.18s ease;
}
.filter-bar-expand.open { display: flex; }
@keyframes filterExpand {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 展开区内的 select */
.filter-bar-expand select {
    flex: 1 1 140px;
    min-width: 110px;
    padding: 0.45rem 0.7rem;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    background: #fff;
    font-size: 0.82rem;
    font-weight: 500;
    color: #444;
    outline: none;
    cursor: pointer;
    font-family: inherit;
}
.filter-bar-expand select:focus { border-color: var(--primary-color); }

/* 展开区内的日期段 */
.filter-bar-date-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1 1 260px;
    min-width: 260px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 0.35rem 0.7rem;
}
.filter-bar-date-group span { font-size: 0.75rem; color: #bbb; white-space: nowrap; }
.filter-bar-date-group input[type=date] {
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.8rem;
    color: #444;
    cursor: pointer;
    width: 95px;
    font-family: inherit;
}


.search-input-wrapper { display: flex; align-items: center; gap: 0.5rem; flex: 1; }
.search-controls-inner { display: flex; align-items: center; gap: 0.8rem; }
body {
    background-color: var(--bg-light);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3 {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.view-section {
    display: none;
}

.view-section.active {
    display: block;
}

/* Nav & Layout */
header {
    padding: 2.5rem 2rem;
    text-align: center;
    background: var(--bg-light);
    border-bottom: 2px solid var(--primary-color);
}

header h1 {
    font-size: 2.2rem;
    letter-spacing: 0.5px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    margin-bottom: auto !important; /* Force extra flex space to the bottom */
    padding: 2rem;
    flex-grow: 1;
    width: 100%;
}

@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }
}

/* Cafe Card */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.2rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-2px);
}

/* Role Selector */
.role-tabs {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.04);
    padding: 0.3rem;
    border-radius: 16px;
    width: fit-content;
    margin: 0 auto;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.role-btn {
    height: 38px;
    padding: 0 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    line-height: 1;
    vertical-align: middle;
    border-radius: 14px;
    border: none;
    background: transparent;
    color: #7f8c8d;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 1.15rem;
    position: relative !important;
    z-index: 5 !important;
    letter-spacing: 0px;
    outline: none !important;
}
.role-btn:focus, .role-btn:active, .role-btn:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.role-btn.active {
    color: var(--primary-color) !important; 
}

.nav-indicator {
    position: absolute;
    height: calc(100% - 0.6rem);
    top: 0.3rem;
    left: 0;
    background: #fff;
    border-radius: 14px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    opacity: 0;
}

/* Form Styling */
.form-group {
    margin-bottom: 0.8rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.9rem;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    outline: none;
    transition: 0.3s;
}

input:focus, select:focus {
    border-color: var(--primary-color);
    background: #fff;
}

.btn {
    padding: 0.8rem 1.6rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
    text-align: center;
}

.btn-primary { 
    background: var(--primary-color); 
    color: #fff; 
}
.btn-primary:hover { 
    background: var(--primary-hover); 
}

.btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

/* Order List Items */
.order-item {
    padding: 1rem;
    border-radius: 15px;
    background: #fff;
    border-left: 5px solid var(--primary-color);
    margin-bottom: 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.status-badge {
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.status-pending_approval { background: #fffde7; color: #afb42b; }
.status-pending_execution { background: #efebe9; color: #5d4037; }
.status-completed { background: #f1f8e9; color: #558b2f; }
.status-rejected { background: #ffebee; color: #c62828; }

/* Table styling for Admin */
table {
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
th {
    background: #f7f3ed;
    color: var(--text-main);
    font-size: 0.8rem;
}
td {
    border-bottom: 1px solid var(--glass-border);
}

/* Department Tags */
#admin-dept-list-tags .action-btn {
    background: #f7f3ed;
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

/* Lightbox - 样式由 HTML 内联控制，此处仅保留背景色覆盖 */
#lightbox {
    background: rgba(0, 0, 0, 0.92) !important;
}


/* Sub-tabs for Admin and User Modes */
.sub-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.sub-tab-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: 0.2s;
}

.sub-tab-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.table-container {
    overflow-x: auto;
}

/* Order Layout Grid */
.order-layout-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 850px) {
    .order-layout-grid {
        grid-template-columns: 1fr;
    }
}

.order-left-panel {
    min-height: 400px;
}

.order-right-panel {
    position: sticky;
    top: 1rem;
    background: rgba(109,76,65,0.03);
    padding: 1.5rem;
    border-radius: 15px;
    border: 1px solid var(--glass-border);
}

.search-input-fancy {
    background: #fff !important;
    border-radius: 40px !important;
    padding-left: 2.8rem !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    border: 1px solid var(--glass-border) !important;
    height: 45px;
}

.total-display {
    background: #fff !important;
    font-weight: 800 !important;
    color: var(--primary-color) !important;
    font-size: 1.4rem !important;
    border: 2px solid var(--primary-color) !important;
    text-align: right;
    padding-right: 1rem !important;
}

.btn-link {
    color: var(--primary-color);
    font-size: 0.85rem;
    text-decoration: none;
    border: 1px solid var(--glass-border);
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    transition: 0.2s;
}

.btn-link:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Animations & Visibility */
.view-section {
    display: none;
    animation: fadeIn 0.3s ease-out forwards;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- 点单界面: 外卖式左右布局 --- */

.sidebar-item:hover {
    background: rgba(109, 76, 65, 0.05);
}

.sidebar-item.active {
    background: #fff !important;
    color: var(--primary-color);
    position: relative;
    font-weight: bold !important;
}

.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 4px;
    background: var(--primary-color);
    border-radius: 0 4px 4px 0;
}

.mode-tabs {
    display: flex;
    background: rgba(109, 76, 65, 0.05);
    padding: 0.2rem;
    border-radius: 12px;
}

.mode-tab {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 10px;
    transition: 0.2s;
    color: #888;
}

.mode-tab.active {
    background: #fff;
    color: var(--primary-color);
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Budget Mode Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.2rem;
    max-width: 1000px;
    margin: 0 auto 2rem auto;
}

.category-card {
    cursor: pointer;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-card:hover {
    background: #fff;
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(62, 39, 35, 0.12);
    border-color: var(--primary-color);
}

@media (max-width: 600px) {
    .category-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}
/* --- Modal & Overlay --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(30, 20, 15, 0.4);
    backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal-container {
    background: #fff;
    width: 95%;
    max-width: 650px;
    max-height: 85vh;
    max-height: 85dvh;
    border-radius: 28px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.5);
    overflow: hidden; /* Important: Clip the children */
    display: flex;
    flex-direction: column;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.modal-header {
    padding: 1.2rem 2rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    z-index: 10;
    flex-shrink: 0;
}

.modal-body {
    padding: 1.5rem 2rem;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}
.modal-body::-webkit-scrollbar-thumb {
    background: rgba(109, 76, 65, 0.2);
    border-radius: 10px;
}

.modal-footer {
    padding: 1.2rem 2rem;
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: #fafafa;
    flex-shrink: 0;
    padding-bottom: max(1.2rem, env(safe-area-inset-bottom));
}

/* --- Login Split Layout --- */
.login-split-container {
    flex-direction: row;
}

.auth-card {
    width: 380px;
    min-height: 580px;
}

#auth-success-badge,
#auth-back-btn {
    display: none;
}

/* Brand Logo Sub Image styles */
.brand-logo-sub-img {
    height: 16px !important;
    width: auto !important;
    margin: 0 !important;
    object-fit: contain !important;
    display: inline-block !important;
    vertical-align: middle !important;
    transform: skewX(15deg) !important; /* Counteract parent badge skew */
}

/* Revenue List Header Layout (Desktop Default) */
.revenue-list-header {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.revenue-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.revenue-actions-wrap {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

#rev-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.8rem;
    border-radius: 20px;
    border: 1px solid rgba(34, 139, 230, 0.2);
    background: rgba(34, 139, 230, 0.06);
    color: #228be6;
    font-size: 0.78rem;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s;
    white-space: nowrap;
}
#rev-back-btn:hover {
    background: rgba(34, 139, 230, 0.12);
    color: #1c7ed6;
    border-color: rgba(34, 139, 230, 0.3);
    transform: translateY(-1px);
}

#rev-list-title {
    margin: 0;
    font-size: 0.9rem;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

#rev-current-store-name {
    margin-left: 0.2rem;
    font-size: 0.95rem;
    font-weight: bold;
    color: var(--primary-color);
    white-space: nowrap;
}

#btn-set-default-store {
    margin-left: 0.5rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.72rem;
    background: #e9ecef;
    color: #495057;
    border: 1px solid #ced4da;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.revenue-unit {
    font-size: 0.72rem;
    color: #adb5bd;
    white-space: nowrap;
}

#rev-export-btn {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    background: #2DCCD3;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(45, 204, 211, 0.2);
    white-space: nowrap;
}

@media (max-width: 768px) {
    .order-amount-cell {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
    }
    .order-amount-cell .amt-label-pc {
        font-size: 0.85rem !important;
    }

    .login-split-container {
        flex-direction: column;
        gap: 1rem !important;
    }
    
    .auth-card {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
        padding: 1.5rem !important;
        transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        overflow: hidden;
    }
    
    /* 默认状态：展开登录，折叠资料 */
    #directory-state {
        height: auto;
        opacity: 1;
        min-height: 480px;
    }
    
    #profile-state {
        height: 70px !important;
        min-height: 70px !important;
        padding: 0 !important;
        cursor: not-allowed;
        overflow: hidden !important;
    }
    
    #profile-state #profile-lock-overlay {
        flex-direction: row !important;
        gap: 0.8rem;
        background: rgba(255,255,255,0.9);
    }
    
    #profile-state #profile-lock-overlay div {
        display: none !important;
    }
    
    #profile-state #profile-lock-overlay div:first-child {
        display: block !important;
        font-size: 1.5rem !important;
        margin: 0 !important;
    }
    
    #profile-state #profile-lock-overlay::after {
        content: "登录后解锁个人资料";
        font-weight: 800;
        font-size: 0.95rem;
        color: #555;
    }
    
    /* 登录成功状态：折叠登录，展开资料 */
    .mobile-auth-success #directory-state {
        height: 60px;
        min-height: 60px !important;
        padding: 0 1.5rem !important;
        display: flex;
        flex-direction: row !important;
        justify-content: space-between;
        align-items: center;
        opacity: 0.7;
    }
    
    .mobile-auth-success #directory-state > div:not(:first-child) {
        display: none !important;
    }
    
    .mobile-auth-success #directory-state > div:first-child {
        margin: 0;
        padding: 0;
        border: none;
    }
    
    .mobile-auth-success #directory-state h3 {
        font-size: 1.1rem !important;
        margin: 0;
    }
    
    .mobile-auth-success #auth-label-tag {
        display: none !important;
    }
    
    .mobile-auth-success #auth-success-badge {
        display: inline-flex !important;
        align-items: center;
        font-weight: 800;
        font-size: 0.8rem;
        color: var(--primary-color);
        background: rgba(52, 211, 153, 0.1);
        padding: 4px 10px;
        border-radius: 12px;
    }
    
    .mobile-auth-success #auth-back-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        border: 1px solid #e2e8f0;
        background: white;
        color: #64748b;
        font-size: 0.75rem;
        font-weight: 800;
        padding: 4px 10px;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.2s;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    }
    
    .mobile-auth-success #auth-back-btn:hover {
        background: #f1f5f9;
        color: #1e293b;
        border-color: #cbd5e1;
    }
    
    .mobile-auth-success #profile-state {
        height: auto;
        min-height: 480px !important;
        padding: 1.5rem !important;
    }
}

/* --- Password Toggle --- */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-toggle {
    position: absolute;
    right: 12px;
    cursor: pointer;
    opacity: 0.3;
    transition: opacity 0.2s;
    user-select: none;
    font-size: 1.1rem;
}

.password-toggle:hover {
    opacity: 1;
}

@keyframes slideUp {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* --- Specs UI --- */
.spec-group {
    margin-bottom: 1.8rem;
}

.spec-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 0.5rem;
}

.spec-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.spec-chip {
    padding: 0.7rem 1.5rem;
    border-radius: 14px;
    background: #f8f8f8;
    border: 1.5px solid transparent;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    font-weight: 500;
    color: #555;
}

.spec-chip:hover {
    background: #fff;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.spec-chip.selected {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 8px 16px rgba(109, 76, 65, 0.25);
}

/* --- Quantity Input Styling --- */
.quantity-input-group {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(109, 76, 65, 0.05);
    padding: 0.3rem 0.5rem;
    border-radius: 25px;
    border: 1px solid transparent;
    transition: 0.3s;
    min-width: 120px;
    justify-content: center;
}

.quantity-input-group:focus-within {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.qty-btn-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: var(--primary-color);
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: 0.2s;
    flex-shrink: 0;
}

.qty-btn-small:hover {
    background: var(--primary-color);
    color: #fff;
}

.qty-input-manual {
    width: 60px;
    min-width: 45px;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: bold;
    font-size: 0.95rem;
    color: var(--text-main);
    outline: none;
    padding: 0;
}

/* Chrome, Safari, Edge, Opera */
.qty-input-manual::-webkit-outer-spin-button,
.qty-input-manual::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
.qty-input-manual[type=number] {
  -moz-appearance: textfield;
}

/* Admin Specs Editor */
.admin-spec-row {
    background: #fdfdfd;
    border: 1px solid #eee;
    border-radius: 18px;
    padding: 1.2rem;
    margin-bottom: 1rem;
    position: relative;
    transition: all 0.3s ease;
}

.admin-spec-row:hover {
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 8px 24px rgba(109,76,65,0.08);
}

.admin-spec-remove {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 28px;
    height: 28px;
    background: var(--danger);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(220,53,69,0.4);
    z-index: 5;
    transition: 0.2s;
}

.admin-spec-remove:hover {
    transform: scale(1.1);
    background: #c82333;
}



/* 订单卡片现代化压缩样式 */
.order-card-compact {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
}

.order-card-compact:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.06);
    border-color: var(--primary-color);
}

.order-main-row {
    padding: 1.2rem 1.5rem;
    display: grid;
    grid-template-columns: 1.2fr 1.5fr 1.2fr auto;
    align-items: center;
    gap: 1.2rem;
    cursor: pointer;
}

.order-detail-panel {
    background: #fbfbfb;
    border-top: 1px solid #f0f0f0;
    padding: 1.5rem;
    display: none;
    animation: slideDownFade 0.4s ease-out;
}

.order-detail-panel.active {
    display: block;
}

@keyframes slideDownFade {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.status-badge-modern {
    padding: 4px 12px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.urgent-banner-mini {
    background: #ff5252;
    color: #fff;
    font-size: 0.7rem;
    padding: 4px 0;
    text-align: center;
    font-weight: 800;
    letter-spacing: 1px;
}

@keyframes orderBreatheRow {
    0% { background-color: rgba(52, 211, 153, 0.4) !important; box-shadow: inset 0 0 10px rgba(52, 211, 153, 0.2); }
    50% { background-color: rgba(52, 211, 153, 0.05) !important; box-shadow: inset 0 0 30px rgba(52, 211, 153, 0.6); }
    100% { background-color: rgba(52, 211, 153, 0.4) !important; box-shadow: inset 0 0 10px rgba(52, 211, 153, 0.2); }
}

.breath-active td {
    animation: orderBreatheRow 1.2s ease-in-out 4 !important;
}


/* =========================================
   BOTTOM NAVIGATION BAR (Hidden on Desktop)
   ========================================= */
.m-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 75px;
    background: #ffffff;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    justify-content: space-around;
    align-items: center;
    z-index: 9999;
    padding-bottom: env(safe-area-inset-bottom, 15px);
}

.m-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    color: #94a3b8;
    text-decoration: none;
    gap: 4px;
    font-size: 0.85rem;
    font-weight: 800;
}

.m-nav-item.active {
    color: var(--primary-color);
}

.m-nav-item i {
    font-size: 1.4rem;
}

/* =========================================
   SENIOR-FRIENDLY MOBILE ADAPTATION
   ========================================= */
@media (max-width: 768px) {
    .order-amount-cell {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
    }
    .order-amount-cell .amt-label-pc {
        font-size: 0.85rem !important;
    }

    
    /* 区分二级导航 (实时进度/历史归档) */
    #user-order-sub-nav {
        background: #f1f5f9 !important;
        border: none !important;
        padding: 4px !important;
        border-radius: 99px !important;
        margin: 0 auto 1.5rem !important;
        max-width: 240px !important;
        gap: 4px !important;
        display: flex !important;
        box-sizing: border-box !important;
    }
    #user-order-sub-nav button {
        font-size: 0.8rem !important;
        padding: 0.45rem 0.8rem !important;
        border-radius: 99px !important;
        font-weight: 600 !important;
        border: none !important;
    }

    /* --- 预定需求表 (Order Form) --- */
    #budget-main-split {
        flex-direction: column !important;
        padding: 0 !important;
    }
    #budget-form-container, .glass-card {
        width: 100% !important;
        min-width: 0 !important;
    }
    .glass-card {
        border-radius: 12px !important;
        padding: 1rem 0.5rem !important;
    }
    /* 单列堆叠表单 */
    #budget-main-split div[style*="grid-template-columns: 1fr 1fr"],
    #budget-main-split div[style*="grid-template-columns: 1.5fr 1fr"],
    #budget-main-split div[style*="grid-template-columns: 1fr 1.2fr"] {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    /* 加大输入框与字体 */
    #budget-main-split input,
    #budget-main-split select,
    #budget-main-split textarea,
    #budget-main-split .date-picker-trigger,
    #budget-main-split .time-picker-trigger {
        font-size: 1.2rem !important;
        height: 55px !important;
        border-width: 2px !important;
        border-color: #d1d5db !important;
        color: #111 !important;
        font-weight: 700 !important;
    }
    #budget-main-split textarea {
        height: auto !important;
        min-height: 120px !important;
    }
    
    #budget-main-split .btn-primary {
        font-size: 1.5rem !important;
        padding: 0.8rem !important;
        height: auto !important;
        border-radius: 12px !important;
    }

    /* --- 我的订单 (My Orders) 深度美化 --- */
    
    /* 1. 顶层统计块 (Summary Bar) */
    /* === 方案A: 用户端金融风格仪表盘 === */
    #user-history-summary-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 0 !important;
        min-width: 100% !important;
        border-radius: 20px !important;
        gap: 0 !important;
        background: #ffffff !important;
        box-shadow: 0 4px 20px rgba(0,0,0,0.06) !important;
        margin-bottom: 1.5rem !important;
        overflow: hidden !important;
        border: 1px solid rgba(45, 204, 211, 0.15) !important;
    }

    /* 总计金额 — 置顶，全宽，大字居中 */
    #user-history-summary-bar > div:last-child {
        order: 1 !important;
        border-left: none !important;
        border-top: none !important;
        padding: 1.8rem 1rem 1.4rem !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        box-sizing: border-box !important;
        background: linear-gradient(135deg, #effbfc 0%, #cbf5f7 100%) !important;
        margin-top: 0 !important;
        border-bottom: 1px solid rgba(45, 204, 211, 0.15) !important;
    }
    #user-history-summary-bar > div:last-child span[style*="font-size: 0.75rem"] {
        font-size: 0.8rem !important;
        color: #078e93 !important;
        font-weight: 700 !important;
        letter-spacing: 1px !important;
        text-transform: uppercase !important;
        margin-bottom: 0.4rem !important;
        display: block !important;
    }
    #user-history-summary-bar > div:last-child span[style*="font-size: 2.2rem"] {
        font-size: 2.6rem !important;
        color: #078e93 !important;
        font-weight: 900 !important;
        line-height: 1 !important;
    }

    /* 期间标签 — 紧跟在总计下方 */
    #user-history-period-label {
        order: 2 !important;
        align-self: center !important;
        margin: 0.8rem auto 0 !important;
        font-size: 0.75rem !important;
        padding: 0.3rem 0.8rem !important;
    }

    /* 修复双概览同时显示的问题 */
    #user-active-metrics[style*="display: none"],
    #user-arc-metrics[style*="display: none"] {
        display: none !important;
    }

    /* 明细数据 — 横向三等分宫格，排在总计之后 */
    #user-active-metrics:not([style*="display: none"]) {
        order: 3 !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 0 !important;
        width: 100% !important;
        padding: 0.6rem 0.8rem 0.8rem !important;
        box-sizing: border-box !important;
        background: #fff !important;
    }
    /* 归档模式：2x2宫格，完美对称与自适应 */
    #user-arc-metrics:not([style*="display: none"]) {
        order: 3 !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0 !important;
        width: 100% !important;
        padding: 0.4rem !important;
        box-sizing: border-box !important;
        background: #fff !important;
        overflow: hidden !important;
    }
    /* 外层 4 个div：2x2宫格，精细边框分割 */
    #user-arc-metrics > div {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: stretch !important;
        padding: 0.8rem 1rem !important;
        border-right: 1px solid #f1f5f9 !important;
        border-bottom: 1px solid #f1f5f9 !important;
        background: transparent !important;
        border-radius: 0 !important;
        overflow: hidden !important;
        min-width: 0 !important;
    }
    /* 右侧一列没有右边框 */
    #user-arc-metrics > div:nth-child(2n) {
        border-right: none !important;
    }
    /* 底下一排没有下边框 */
    #user-arc-metrics > div:nth-child(3),
    #user-arc-metrics > div:nth-child(4) {
        border-bottom: none !important;
    }
    /* 内层 div：每行显示标签+数字，左右排列 */
    #user-arc-metrics > div > div {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        gap: 0.5rem !important;
        min-width: 0 !important;
        overflow: hidden !important;
        padding: 0.2rem 0 !important;
    }
    /* 标签文字 — 增加字号提升移动端可读性 */
    #user-arc-metrics > div > div > span:first-child {
        font-size: 0.68rem !important;
        color: #64748b !important;
        font-weight: 600 !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        overflow: hidden !important;
    }
    /* 金额及笔数数字 — 增加字号与可读性 */
    #user-arc-metrics > div > div > span:last-child {
        font-size: 0.9rem !important;
        font-weight: 800 !important;
        text-align: right !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        flex-shrink: 1 !important;
        min-width: 0 !important;
    }

    /* 实时进度模式：3等分横排 */
    #user-active-metrics > div {
        flex: 1 1 0 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        border-bottom: none !important;
        padding: 0.6rem 0.2rem !important;
        background: transparent !important;
        border-radius: 0 !important;
        border-right: 1px solid #f0f0f0 !important;
    }
    #user-active-metrics > div:last-child {
        border-right: none !important;
    }
    #user-active-metrics > div > span:first-child {
        font-size: 0.6rem !important;
        color: #999 !important;
        font-weight: 600 !important;
        margin-bottom: 0.2rem !important;
        text-align: center !important;
        white-space: nowrap !important;
    }
    #user-active-metrics > div > span:last-child {
        font-size: 0.95rem !important;
        color: #222 !important;
        font-weight: 800 !important;
        text-align: center !important;
    }

    .filter-bar-row {
        padding: 0.45rem 0.7rem !important;
        gap: 0.4rem !important;
        border-radius: 10px !important;
        flex-wrap: wrap !important; /* Allow wrapping on small screens if it doesn't fit */
    }
    /* 展开区全宽 */
    .filter-bar-expand {
        padding: 0.6rem 0.7rem !important;
        gap: 0.4rem !important;
    }
    .filter-bar-expand select {
        flex: 1 1 calc(50% - 0.4rem) !important;
        min-width: 0 !important;
        font-size: 0.78rem !important;
        padding: 0.4rem 0.5rem !important;
    }
    .filter-bar-date-group {
        flex: 1 1 100% !important;
        min-width: 0 !important;
    }
    
    #history-section > div[style*="display: flex; flex-wrap: wrap"] {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 0 !important; /* 移除外层多余内边距 */
        background: transparent !important; /* 移除白色背景卡片 */
        box-shadow: none !important; /* 移除阴影 */
        gap: 0.6rem !important;
        margin-bottom: 1.5rem !important;
    }
    #history-section > div[style*="display: flex; flex-wrap: wrap"] > div {
        width: 100% !important;
        flex: none !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 0.6rem !important;
        justify-content: space-between !important;
    }
    #user-history-search-input {
        height: 44px !important;
        width: 100% !important;
        font-size: 0.95rem !important;
        color: #111 !important;
        border: none !important; /* 去除边框 */
        border-radius: 22px !important; /* 胶囊圆角，像微信搜索框 */
        font-weight: 600 !important;
        background: #f2f2f2 !important; /* 浅灰底色 */
        padding: 0 1.2rem !important;
    }
    #user-order-status-filter,
    #user-order-source-filter {
        height: 40px !important;
        font-size: 1rem !important;
        color: #444 !important;
        border: none !important; /* 去除边框 */
        border-radius: 12px !important; /* 柔和圆角 */
        font-weight: 600 !important;
        background: #f2f2f2 !important; /* 浅灰底色 */
        padding: 0 0.8rem !important;
        flex: 1 !important;
        min-width: 45% !important;
    }
    #user-offline-order-btn {
        height: 44px !important;
        font-size: 1.1rem !important;
        border-radius: 22px !important;
        width: 100% !important;
        margin-top: 0 !important;
    }

    /* 3. 订单表格转卡片 (Table to Cards) */
    .responsive-order-table, 
    .responsive-order-table thead, 
    .responsive-order-table tbody, 
    .responsive-order-table th, 
    .responsive-order-table td { 
        display: block !important; 
        width: 100% !important; 
    }
    
    /* 只对没有内联隐藏的行应用 block，解决无法收放的问题 */
    .responsive-order-table tr:not([style*="display: none"]):not([style*="display:none"]) {
        display: block !important; 
        width: 100% !important; 
    }
    
    .responsive-order-table tr[style*="display: none"],
    .responsive-order-table tr[style*="display:none"] {
        display: none !important;
    }
    
    /* 隐藏电脑版表头 */
    .responsive-order-table thead { 
        display: none !important; 
    }
    
    /* --- 订单卡片专业重构 (Mobile Order Card Grid - Stripe Minimalist) --- */
    .responsive-order-table tr:not(.month-header-row):not(.order-details-row):not([style*="display: none"]):not([style*="display:none"]) {
        display: grid !important;
        grid-template-columns: 1fr auto !important;
        gap: 0.5rem !important;
        background: #ffffff !important;
        border-radius: 16px !important;
        padding: 0.9rem 1rem !important;
        box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.03) !important; /* 超轻量阴影，消除疲劳 */
        border: 1px solid #f1f5f9 !important; /* 极柔和边框 */
        margin-bottom: 0.8rem !important;
        position: relative !important;
    }
    
    /* 隐藏所有冗余、重复的 td::before 标签 */
    .responsive-order-table td::before {
        display: none !important;
    }
    
    /* 对各个单元格进行精确排版 */
    .responsive-order-table td {
        text-align: left !important;
        padding: 0 !important;
        border-bottom: none !important;
        display: block !important;
        line-height: 1.4 !important;
        width: 100% !important;
    }
    
    /* 1. 单号/日期 (左上角) */
    .responsive-order-table td[data-label="单号 / 日期"] {
        grid-column: 1 / 2 !important;
        grid-row: 1 / 2 !important;
        padding-left: 0.5rem !important;
        border-left-width: 3px !important; /* 让高亮侧边条变细，更加高级 */
    }
    
    /* 2. 状态 (右上角) */
    .responsive-order-table td[data-label="状态"] {
        grid-column: 2 / 3 !important;
        grid-row: 1 / 2 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        text-align: right !important;
    }
    .responsive-order-table td[data-label="状态"] > span {
        font-size: 0.75rem !important; /* 状态徽章微缩，更精致 */
        font-weight: 700 !important;
        padding: 2px 8px !important;
        border-radius: 9999px !important;
    }
    
    /* 3. 客户信息 (通宽，排在第二行) */
    .responsive-order-table td[data-label="客户信息"] {
        grid-column: 1 / -1 !important;
        grid-row: 2 / 3 !important;
        border-top: 1px solid #f8fafc !important;
        padding-top: 0.4rem !important;
        margin-top: 0.1rem !important;
    }
    
    /* 3.5 签字情况 (通宽，排在第三行，高度紧凑自适应) */
    .responsive-order-table td[data-label="签字情况"] {
        grid-column: 1 / -1 !important;
        grid-row: 3 / 4 !important;
        border-top: 1px dashed #f1f5f9 !important;
        padding: 0.6rem 0 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
    
    /* 4. 需求说明 (通宽，排在第三行，美化为无边框极简气泡框) */
    .responsive-order-table td[data-label="需求说明"] {
        grid-column: 1 / -1 !important;
        grid-row: 3 / 4 !important;
        background: #f8fafc !important; /* 极浅冷灰底色 */
        border: 1px solid #f1f5f9 !important;
        padding: 0.5rem 0.75rem !important;
        border-radius: 8px !important;
        margin: 0.1rem 0 !important;
        box-sizing: border-box !important;
    }
    .responsive-order-table td[data-label="需求说明"] > div {
        font-size: 0.88rem !important; /* 微缩字体，极大减少压迫感 */
        line-height: 1.5 !important;
        color: #334155 !important; /* Slate字色，不刺眼 */
    }
    
    /* 5. 金额 (通宽，排在第四行，美化为小收据行) */
    .responsive-order-table td[data-label="金额"] {
        grid-column: 1 / -1 !important;
        grid-row: 4 / 5 !important;
        border-top: 1px dashed #f1f5f9 !important;
        padding-top: 0.4rem !important;
    }
    
    /* 6. 操作 (通宽，底部) */
    .responsive-order-table td[data-label="操作"] {
        grid-column: 1 / -1 !important;
        grid-row: 5 / 6 !important;
        margin-top: 0.3rem !important;
    }
    .responsive-order-table td[data-label="操作"] button {
        height: 34px !important; /* 按钮收缩至极其精致的高度 */
        font-size: 0.85rem !important;
        border-radius: 6px !important;
        margin-bottom: 0 !important;
    }

    /* 特殊处理：月份汇总行 (不作为普通卡片显示) */
    .responsive-order-table tr.month-header-row {
        display: flex !important;
        align-items: center !important;
        background: #f1f1f1 !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0.6rem 1rem !important;
        margin-bottom: 0.5rem !important;
        border-radius: 8px !important;
    }
    .responsive-order-table tr.month-header-row td {
        padding: 0 !important;
        border: none !important;
        width: 100% !important;
    }
    .responsive-order-table tr.month-header-row td::before {
        display: none !important;
    }
    
    /* 按钮在卡片内撑满 */
    .responsive-order-table td[data-label="操作"] button {
        height: 50px !important;
        font-size: 1.2rem !important;
    }

    /* 详情折叠行 */
    .responsive-order-table tr.order-details-row {
        margin-top: -1.5rem !important;
        border-top-left-radius: 0 !important;
        border-top-right-radius: 0 !important;
        border-top: none !important;
        box-shadow: inset 0 4px 10px rgba(0,0,0,0.02) !important;
        background: #fafafa !important;
        padding-top: 0 !important;
    }
    .responsive-order-table tr.order-details-row td::before {
        display: none !important;
    }
    
    #user-orders-container {
        padding-bottom: 120px !important;
    }

    /* Client-side Mobile Adaptation (Legacy rules preserved for global-header) */
    #global-header:not([style*="display: none"]):not([style*="display:none"]) {
        height: auto !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0.4rem 0.75rem !important;
        gap: 0.4rem !important;
        background: rgba(255, 255, 255, 0.85) !important;
        backdrop-filter: saturate(180%) blur(20px) !important;
        -webkit-backdrop-filter: saturate(180%) blur(20px) !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    }
    
    #global-header > div:first-child {
        flex: 0 0 auto !important;
        width: auto !important;
        justify-content: flex-start !important;
        margin-bottom: 0 !important;
    }


    #global-header > div:nth-child(3) {
        flex: 0 0 auto !important;
        width: auto !important;
        order: 2 !important;
        justify-content: flex-end !important;
        align-items: center !important;
        margin-bottom: 0 !important;
        gap: 0.4rem !important;
    }
    
    #global-header > div:nth-child(3) > div[style*="width: 1px"] {
        display: none !important;
    }

    #global-header > div:nth-child(3) > div:first-child {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: rgba(100, 116, 139, 0.06) !important;
        border: 1px solid rgba(100, 116, 139, 0.1) !important;
        color: #475569 !important;
        padding: 0.3rem 0.6rem !important;
        border-radius: 50px !important;
        font-size: 0.72rem !important;
        font-weight: 700 !important;
        gap: 0.2rem !important;
        transition: all 0.2s ease !important;
    }

    #global-header > div:nth-child(3) > div:last-child {
        display: flex !important;
        gap: 0.4rem !important;
        align-items: center !important;
    }

    #global-admin-btn {
        background: rgba(45, 204, 211, 0.15) !important;
        border: 1px solid rgba(45, 204, 211, 0.25) !important;
        color: #078e93 !important;
        font-size: 0.72rem !important;
        padding: 0.3rem 0.6rem !important;
        border-radius: 50px !important;
        font-weight: 700 !important;
        align-items: center !important;
        gap: 0.2rem !important;
        text-decoration: none !important;
        transition: all 0.2s ease !important;
    }

    #global-logout-btn {
        background: #f2f2f2 !important;
        border: 1px solid #e5e5e5 !important;
        color: #555 !important;
        font-size: 0.72rem !important;
        padding: 0.3rem 0.6rem !important;
        border-radius: 50px !important;
        font-weight: 700 !important;
        align-items: center !important;
        gap: 0.2rem !important;
        text-decoration: none !important;
        transition: all 0.2s ease !important;
    }

    @media (max-width: 480px) {
        #global-header:not([style*="display: none"]):not([style*="display:none"]) {
            padding: 0.4rem 0.5rem !important;
            gap: 0.2rem !important;
        }
        .brand-logo-text {
            font-size: 1.25rem !important;
        }
        .brand-logo-badge-wrap {
            margin-left: 4px !important;
        }
        .brand-logo-sub {
            padding: 2px 4px !important;
            border-radius: 4px !important;
        }
        .brand-logo-sub-img {
            height: 11px !important;
        }
        .brand-logo-jls {
            font-size: 0.5rem !important;
            margin-left: 2px !important;
            margin-top: -3px !important;
        }
        #global-admin-btn, #global-logout-btn {
            width: 28px !important;
            height: 28px !important;
            padding: 0 !important;
            justify-content: center !important;
            border-radius: 50% !important;
        }
        #global-admin-btn span, #global-logout-btn span {
            display: none !important;
        }
        .admin-header-bar {
            padding: 0.4rem 0.5rem !important;
            gap: 0.2rem !important;
        }
        .admin-header-top {
            padding: 0 !important;
        }
        .admin-logo-wrap > div > div {
            font-size: 1.25rem !important;
        }
        .admin-header-actions {
            gap: 0.4rem !important;
        }
        .admin-header-divider {
            display: none !important;
        }
        .admin-user-info, .push-toggle-btn, .admin-header-link {
            width: 28px !important;
            height: 28px !important;
            padding: 0 !important;
            justify-content: center !important;
            border-radius: 50% !important;
            display: inline-flex !important;
            align-items: center !important;
            box-sizing: border-box !important;
            background: #f2f2f2 !important;
            border: 1px solid #e5e5e5 !important;
            color: #555 !important;
            transition: all 0.2s ease !important;
            min-width: 28px !important;
            min-height: 28px !important;
        }
        .push-toggle-btn.push-on {
            background: rgba(16, 185, 129, 0.15) !important;
            border: 1px solid rgba(16, 185, 129, 0.25) !important;
            color: #10b981 !important;
        }
        .push-toggle-btn.push-off {
            background: #f2f2f2 !important;
            border: 1px solid #e5e5e5 !important;
            color: #94a3b8 !important;
        }
        .admin-header-link[href="/?mode=order"] {
            background: rgba(109, 76, 65, 0.15) !important;
            border: 1px solid rgba(109, 76, 65, 0.25) !important;
            color: #6d4c41 !important;
        }
        .admin-user-info span, #push-status-text, .admin-header-link span {
            display: none !important;
        }
    }

    @media (max-width: 400px) {
        #global-header > div:nth-child(3) > div:first-child {
            width: 28px !important;
            height: 28px !important;
            padding: 0 !important;
            justify-content: center !important;
            border-radius: 50% !important;
        }
        #global-header > div:nth-child(3) > div:first-child span {
            display: none !important;
        }
    }
    
    #global-header > div:nth-child(2) {
        flex: 1 1 100% !important;
        width: 100% !important;
        order: 3 !important;
        margin-top: 0.6rem !important;
        margin-bottom: 0.2rem !important;
        display: flex !important;
        justify-content: center !important;
    }
    
    #user-nav.role-tabs {
        max-width: 280px !important; /* Narrowed width on mobile to avoid layout crowding */
        width: 100% !important;
        display: flex !important;
        justify-content: space-around !important;
        background: rgba(15, 23, 42, 0.05) !important;
        border-radius: 99px !important;
        padding: 3px !important;
        box-sizing: border-box !important;
        flex-wrap: nowrap !important;
        position: relative !important;
    }

    #global-header .nav-indicator {
        height: calc(100% - 6px) !important;
        top: 3px !important;
        border-radius: 99px !important;
        background: #ffffff !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06) !important;
    }
    
    #user-nav .role-btn {
        flex: 1 !important;
        height: 32px !important;
        padding: 0 !important;
        font-size: 0.85rem !important;
        font-weight: 600 !important;
        border-radius: 99px !important;
        white-space: nowrap !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
        color: #64748b !important;
        border: none !important;
        outline: none !important;
    }

    .role-btn:focus, .role-btn:active, .role-btn:focus-visible {
        outline: none !important;
        box-shadow: none !important;
    }

    #user-nav .role-btn.active {
        color: var(--primary-color) !important;
        font-weight: 800 !important;
    }
    
    .sub-tabs {
        overflow-x: auto !important;
        white-space: nowrap !important;
        flex-wrap: nowrap !important;
        padding-bottom: 0.5rem !important;
        scrollbar-width: none;
    }
    
    .sub-tabs::-webkit-scrollbar {
        display: none;
    }

    /* === 方案A: 管理端金融风格仪表盘 (with user端一致) === */
    #admin-summary-ribbon {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 0 !important;
        gap: 0 !important;
        width: 100% !important;
        min-width: 100% !important;
        box-sizing: border-box !important;
        margin-bottom: 1rem !important;
        border-radius: 20px !important;
        overflow: hidden !important;
        background: #fff !important;
        box-shadow: 0 4px 20px rgba(0,0,0,0.06) !important;
        border: 1px solid rgba(45, 204, 211, 0.15) !important;
    }

    /* 期间标签 */
    #metric-archive-period-label {
        order: 2 !important;
        align-self: center !important;
        margin: 0.8rem auto 0 !important;
        font-size: 0.75rem !important;
        padding: 0.3rem 0.8rem !important;
    }


    /* 总计金额 — 置顶，全宽，大字居中 */
    #admin-summary-ribbon > div:last-child {
        order: 1 !important;  /* 总计置顶 */
        margin-left: 0 !important;
        border-left: none !important;
        border-top: none !important;
        padding: 1.8rem 1rem 1.4rem !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        background: linear-gradient(135deg, #effbfc 0%, #cbf5f7 100%) !important;
        border-bottom: 1px solid rgba(45, 204, 211, 0.15) !important;
        border-radius: 0 !important;
        box-sizing: border-box !important;
        margin-bottom: 0 !important;
    }
    #admin-summary-ribbon > div:last-child > span:first-child {
        font-size: 0.8rem !important;
        color: #078e93 !important;
        font-weight: 700 !important;
        letter-spacing: 1px !important;
        margin-bottom: 0.4rem !important;
        display: block !important;
    }
    #admin-summary-ribbon > div:last-child > span:last-child {
        font-size: 2.6rem !important;
        color: #078e93 !important;
        font-weight: 900 !important;
        line-height: 1 !important;
    }

    /* 实时进度模式指标区块 — 3等分横排 */
    #admin-active-metrics {
        order: 3 !important;
        display: flex;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 0 !important;
        width: 100% !important;
        padding: 0.6rem 0.4rem 0.8rem !important;
        box-sizing: border-box !important;
        background: #fff !important;
    }
    #admin-active-metrics > div {
        flex: 1 1 0 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        border-bottom: none !important;
        padding: 0.6rem 0.2rem !important;
        background: transparent !important;
        border-radius: 0 !important;
        border-right: 1px solid #f0f0f0 !important;
        border: none !important;
        border-right: 1px solid #f0f0f0 !important;
    }
    #admin-active-metrics > div:last-child {
        border-right: none !important;
    }
    #admin-active-metrics > div > span:first-child {
        font-size: 0.6rem !important;
        color: #999 !important;
        font-weight: 600 !important;
        margin-bottom: 0.2rem !important;
        text-align: center !important;
        white-space: nowrap !important;
    }
    #admin-active-metrics > div > span:last-child {
        font-size: 0.95rem !important;
        color: #222 !important;
        font-weight: 800 !important;
        text-align: center !important;
    }

    /* 归档模式指标区块 — 2x2宫格，完美对称与自适应 */
    #admin-arc-metrics:not([style*="display: none"]) {
        order: 3 !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0 !important;
        width: 100% !important;
        padding: 0.4rem !important;
        box-sizing: border-box !important;
        background: #fff !important;
        overflow: hidden !important;
    }
    /* 外层 4 个div：2x2宫格，精细边框分割 */
    #admin-arc-metrics > div {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: stretch !important;
        padding: 0.8rem 1rem !important;
        border-right: 1px solid #f1f5f9 !important;
        border-bottom: 1px solid #f1f5f9 !important;
        background: transparent !important;
        border-radius: 0 !important;
        overflow: hidden !important;
        min-width: 0 !important;
    }
    /* 右侧一列没有右边框 */
    #admin-arc-metrics > div:nth-child(2n) {
        border-right: none !important;
    }
    /* 底下一排没有下边框 */
    #admin-arc-metrics > div:nth-child(3),
    #admin-arc-metrics > div:nth-child(4) {
        border-bottom: none !important;
    }
    /* 内层 div：每行显示标签+数字，左右排列 */
    #admin-arc-metrics > div > div {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        gap: 0.5rem !important;
        min-width: 0 !important;
        overflow: hidden !important;
        padding: 0.2rem 0 !important;
    }
    /* 标签文字 — 增加字号提升移动端可读性 */
    #admin-arc-metrics > div > div > span:first-child {
        font-size: 0.68rem !important;
        color: #64748b !important;
        font-weight: 600 !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }
    /* 金额及笔数数字 — 增加字号与可读性 */
    #admin-arc-metrics > div > div > span:last-child {
        font-size: 0.9rem !important;
        font-weight: 800 !important;
        text-align: right !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        flex-shrink: 1 !important;
        min-width: 0 !important;
    }
    
    .admin-filters-array {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem !important;
    }
    
    .admin-filters-array > div[style*="width: 1px"] {
        display: none !important;
    }
    
    .admin-filters-array > div:not([style*="width: 1px"]):not(.admin-filter-full-width) {
        width: 100% !important;
        flex: 1 !important;
    }
    
    .admin-filters-array > div.admin-filter-full-width {
        grid-column: span 2 !important;
        width: 100% !important;
    }
    
    .admin-filters-array > button.btn {
        grid-column: span 2 !important;
        width: 100% !important;
        margin-left: 0 !important;
        justify-content: center !important;
    }
    
    .admin-filters-array input, .admin-filters-array select {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* =========================================
       STORE REVENUE & SYSTEM SETTINGS MOBILE
       ========================================= */
    
    /* 1. Store Revenue (#tab-revenue) Mobile Styles */
    #tab-revenue select {
        padding: 0.45rem !important;
        font-size: 0.8rem !important;
        border-radius: 8px !important;
        border: 1px solid #ddd !important;
        background: #fff !important;
        box-sizing: border-box !important;
    }

    #tab-revenue div[style*="display: flex; gap: 0.8rem; align-items: center"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
        background: rgba(255, 255, 255, 0.7) !important;
    }

    #tab-revenue div[style*="display: flex; gap: 0.8rem; align-items: center"] > div {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
    }
    
    #tab-revenue div[style*="display: flex; gap: 0.8rem; align-items: center"] > div[style*="width: 1px"] {
        display: none !important;
    }

    #tab-revenue div[style*="display: flex; gap: 0.8rem; align-items: center"] select {
        width: 60% !important;
        min-width: 0 !important;
    }

    #rev-summary-ribbon {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.4rem !important;
        padding: 0.8rem !important;
        box-sizing: border-box !important;
        background: #f8f9fa !important;
        border-radius: 12px !important;
        margin-bottom: 1rem !important;
    }

    #rev-summary-ribbon > div {
        border-right: none !important;
        padding-right: 0 !important;
        text-align: center !important;
    }

    #rev-summary-ribbon > div > div:first-child {
        font-size: 0.65rem !important;
        margin-bottom: 0.2rem !important;
        color: #7f8c8d !important;
        white-space: nowrap !important;
    }

    #rev-summary-ribbon > div > div:last-child {
        font-size: 0.95rem !important;
        font-weight: 800 !important;
    }

    #rev-summary-ribbon > div:last-child {
        grid-column: span 3 !important;
        margin-left: 0 !important;
        display: flex !important;
        justify-content: center !important;
        margin-top: 0.3rem !important;
    }

    #rev-summary-ribbon > div:last-child button {
        width: 100% !important;
        padding: 0.5rem !important;
        font-weight: bold !important;
        font-size: 0.78rem !important;
        border-radius: 8px !important;
        border: 1px solid #ced4da !important;
        background: #ffffff !important;
    }

    .revenue-list-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.8rem !important;
        padding: 0.5rem 1rem 0.5rem 1rem !important;
    }

    .revenue-title-wrap {
        display: flex !important;
        align-items: center !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }

    .revenue-title-wrap > h3 {
        font-size: 0.95rem !important;
        margin: 0 !important;
        display: inline-block !important;
    }

    .revenue-title-wrap > span {
        font-size: 0.95rem !important;
        margin-left: 0.2rem !important;
        display: inline-block !important;
    }

    #btn-set-default-store {
        margin-left: 0.5rem !important;
        padding: 0.2rem 0.5rem !important;
        font-size: 0.7rem !important;
        background: #f1f3f5 !important;
        border: 1px solid #dee2e6 !important;
        border-radius: 6px !important;
        display: inline-block;
        width: auto !important;
        height: auto !important;
    }

    .revenue-actions-wrap {
        margin-left: 0 !important;
        margin-top: 0.4rem !important;
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        border-top: 1px dashed rgba(0, 0, 0, 0.05) !important;
        padding-top: 0.5rem !important;
    }

    #rev-export-btn {
        font-size: 0.75rem !important;
        padding: 0.4rem 1rem !important;
    }

    /* 2. System Settings (#tab-settings) Mobile Styles */
    #tab-settings > div:first-child {
        display: flex !important;
        width: 100% !important;
        background: rgba(0,0,0,0.03) !important;
        padding: 0.2rem !important;
        border-radius: 12px !important;
        box-sizing: border-box !important;
        gap: 0.2rem !important;
    }

    #tab-settings > div:first-child .sub-tab-btn {
        flex: 1 !important;
        margin: 0 !important;
        padding: 0.4rem 0 !important;
        font-size: 0.72rem !important;
        font-weight: 700 !important;
        border-radius: 10px !important;
        white-space: nowrap !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        background: transparent !important;
        color: #64748b !important;
        border: none !important;
        transition: all 0.2s ease !important;
    }

    #tab-settings > div:first-child .sub-tab-btn.active {
        background: #ffffff !important;
        color: var(--primary-color) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    }

    /* User Registration Subview */
    #tab-settings #user-form-title {
        font-size: 0.95rem !important;
    }

    #tab-settings #settings-subview-users div[style*="justify-content: space-between"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.6rem !important;
    }

    #tab-settings #settings-subview-users div[style*="justify-content: space-between"] > div:last-child {
        display: flex !important;
        width: 100% !important;
        justify-content: space-between !important;
        gap: 0.4rem !important;
    }

    #tab-settings #settings-subview-users div[style*="justify-content: space-between"] label {
        flex: 1 !important;
        text-align: center !important;
        justify-content: center !important;
        padding: 0.35rem 0.4rem !important;
        font-size: 0.72rem !important;
        border-radius: 8px !important;
    }

    #tab-settings #settings-subview-users div[style*="gap: 0.8rem; align-items: center"] {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.6rem !important;
    }

    #tab-settings #settings-subview-users div[style*="gap: 0.8rem; align-items: center"] > input,
    #tab-settings #settings-subview-users div[style*="gap: 0.8rem; align-items: center"] > div {
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    #tab-settings #settings-subview-users div[style*="gap: 0.8rem; align-items: center"] > div:last-child {
        grid-column: span 2 !important;
    }

    /* Category Management (Explorer) Subview */
    #product-sub-cats > div[style*="display: flex; gap: 1px"] {
        flex-direction: column !important;
        height: auto !important;
        border-radius: 12px !important;
    }

    #product-sub-cats div[style*="width: 280px"] {
        width: 100% !important;
        height: 220px !important;
        border-bottom: 2px solid #eee !important;
    }

    #cat-explorer-editor {
        padding: 1rem !important;
        height: auto !important;
    }

    #cat-editor-form div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }

    #cat-editor-form div[style*="grid-template-columns: 1fr 1fr auto"] {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }

    #cat-editor-form div[style*="grid-template-columns: 1fr 1fr auto"] button {
        width: 100% !important;
        padding: 0.5rem !important;
    }

    /* Time Management Subview */
    #settings-subview-time > div {
        padding: 0.8rem !important;
    }

    #settings-subview-time div[style*="grid-template-columns: 1fr 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }

    /* Order Cards Optimization & Detail Card Stacking on Mobile */
    .order-details-wrapper {
        padding: 0 0.5rem !important;
    }
    .order-details-wrapper.expanded {
        padding: 0.8rem 0.5rem !important;
        max-height: none !important;
    }
    .order-details-grid {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }
    .order-details-card {
        grid-column: span 1 !important;
        padding: 0.8rem 1rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Prevent Date/Text Wrapping in Store Revenue Tables (Always Single Line) */
    #tab-revenue table th,
    #tab-revenue table td {
        white-space: nowrap !important;
        padding: 0.6rem 0.8rem !important;
        font-size: 0.8rem !important;
        vertical-align: middle !important;
    }

    /* Compact Back Button in Revenue Detail Page */
    #rev-back-btn {
        padding: 0.3rem 0.8rem !important;
        font-size: 0.78rem !important;
        border-radius: 20px !important;
        box-shadow: none !important;
        height: auto !important;
        width: auto !important;
        display: inline-flex;
        align-items: center !important;
        gap: 0.25rem !important;
        align-self: flex-start !important;
    }

    /* =========================================
       NATIVE MOBILE CARD VIEW FOR SYSTEM SETTINGS TABLE
       ========================================= */
    #tab-settings table thead {
        display: none !important;
    }
    
    #tab-settings table,
    #tab-settings tbody,
    #tab-settings tr {
        display: block !important;
        width: 100% !important;
    }
    
    /* Department grouping header rows */
    #tab-settings tbody tr:has(td[colspan="7"]) {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0.8rem 0 0.4rem 0 !important;
        margin: 0 !important;
    }
    #tab-settings tbody tr:has(td[colspan="7"]) td {
        display: block !important;
        width: 100% !important;
        background: transparent !important;
        border: none !important;
        font-weight: 800 !important;
        font-size: 0.85rem !important;
        color: var(--primary-color) !important;
        padding: 0 !important;
    }
    
    /* Individual user card rows */
    #tab-settings tbody tr:not(:has(td[colspan="7"])) {
        background: #ffffff !important;
        border: 1px solid rgba(0, 0, 0, 0.05) !important;
        border-radius: 16px !important;
        padding: 1rem !important;
        margin-bottom: 0.5rem !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.01) !important;
        position: relative !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    #tab-settings tbody tr:not(:has(td[colspan="7"])) td {
        display: block !important;
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
        font-size: 0.82rem !important;
        color: #475569 !important;
        text-align: left !important;
        width: auto !important;
    }
    
    /* Account Column styling with Icon */
    #tab-settings tbody tr:not(:has(td[colspan="7"])) td:nth-child(1) {
        font-size: 0.95rem !important;
        font-weight: 800 !important;
        color: #1e293b !important;
        display: inline-flex !important;
        align-items: center !important;
    }
    #tab-settings tbody tr:not(:has(td[colspan="7"])) td:nth-child(1):before {
        content: "📞 账号: " !important;
        font-weight: normal !important;
        color: #64748b !important;
        font-size: 0.8rem !important;
    }
    
    /* Password Column styling with Icon */
    #tab-settings tbody tr:not(:has(td[colspan="7"])) td:nth-child(2) {
        font-size: 0.85rem !important;
        color: var(--primary-color) !important;
        letter-spacing: 1px !important;
        display: inline-flex !important;
        align-items: center !important;
    }
    #tab-settings tbody tr:not(:has(td[colspan="7"])) td:nth-child(2):before {
        content: "🔑 密码: " !important;
        font-weight: normal !important;
        color: #64748b !important;
        font-size: 0.8rem !important;
        letter-spacing: 0px !important;
        margin-right: 0.2rem !important;
    }

    /* Name Column styling with Icon */
    #tab-settings tbody tr:not(:has(td[colspan="7"])) td:nth-child(3) {
        font-size: 0.85rem !important;
        font-weight: 700 !important;
        display: inline-flex !important;
        align-items: center !important;
    }
    #tab-settings tbody tr:not(:has(td[colspan="7"])) td:nth-child(3):before {
        content: "👤 姓名: " !important;
        font-weight: normal !important;
        color: #64748b !important;
        font-size: 0.8rem !important;
        margin-right: 0.2rem !important;
    }

    /* Department/Roles Column styling with Icon */
    #tab-settings tbody tr:not(:has(td[colspan="7"])) td:nth-child(4) {
        font-size: 0.8rem !important;
        color: #475569 !important;
        padding-top: 0.3rem !important;
        border-top: 1px dashed rgba(0, 0, 0, 0.05) !important;
        margin-top: 0.2rem !important;
        line-height: 1.4 !important;
    }
    #tab-settings tbody tr:not(:has(td[colspan="7"])) td:nth-child(4):before {
        content: "💼 部门与角色: " !important;
        font-weight: normal !important;
        color: #64748b !important;
    }
    
    /* Store permissions Column styling with Icon */
    #tab-settings tbody tr:not(:has(td[colspan="7"])) td:nth-child(5) {
        display: flex !important;
        align-items: center !important;
        gap: 0.3rem !important;
        margin-top: 0.1rem !important;
    }
    #tab-settings tbody tr:not(:has(td[colspan="7"])) td:nth-child(5):before {
        content: "🏪 负责门店: " !important;
        font-weight: normal !important;
        color: #64748b !important;
        font-size: 0.8rem !important;
    }
    
    /* Action Buttons (Edit/Delete) Column styling as footer bar */
    #tab-settings tbody tr:not(:has(td[colspan="7"])) td:nth-child(6) {
        margin-top: 0.6rem !important;
        padding-top: 0.6rem !important;
        border-top: 1px solid rgba(0, 0, 0, 0.05) !important;
        width: 100% !important;
    }
    #tab-settings tbody tr:not(:has(td[colspan="7"])) td:nth-child(6) > div {
        display: flex !important;
        width: 100% !important;
        gap: 0.6rem !important;
        justify-content: space-between !important;
    }
    #tab-settings tbody tr:not(:has(td[colspan="7"])) td:nth-child(6) button {
        flex: 1 !important;
        width: 100% !important;
        padding: 0.45rem !important;
        font-weight: bold !important;
        font-size: 0.78rem !important;
        border-radius: 8px !important;
        justify-content: center !important;
        height: auto !important;
    }
}


/* --- Order Form Mobile Optimization --- */
@media (max-width: 768px) {
    .order-amount-cell {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
    }
    .order-amount-cell .amt-label-pc {
        font-size: 0.85rem !important;
    }

    .budget-inner-card {
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        box-shadow: none !important;
        margin-bottom: 0 !important;
    }

    #budget-form-container .glass-card {
        padding: 0.9rem !important;
        background: #ffffff !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.03) !important;
        border: none !important;
        border-radius: 20px !important;
    }
    #budget-form-container .glass-card > div {
        gap: 0.38rem !important; /* tight spacing between elements in the card */
    }
    
    #budget-main-split .form-group {
        background: transparent !important;
        padding: 0 !important;
        border-radius: 0 !important;
        margin-bottom: 0.8rem !important;
        box-shadow: none !important;
        border: none !important;
    }
    #budget-main-split div[style*="grid-template-columns: 1fr 1fr"] {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.6rem !important;
        background: transparent !important;
        padding: 0 !important;
        border-radius: 0 !important;
        margin-bottom: 0 !important;
        box-shadow: none !important;
    }
    
    
    #budget-main-split input,
    #budget-main-split select,
    #budget-main-split textarea {
        background: #ffffff !important;
        border: 1px solid #cbd5e1 !important;
        box-shadow: 0 1px 2px rgba(0,0,0,0.02) !important;
        border-radius: 10px !important;
        padding: 0 1rem !important;
        font-size: var(--font-size-input) !important;
        font-weight: 600 !important;
        color: #1e293b !important;
        height: 44px !important; /* Unified mobile height */
        transition: all 0.2s;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    #budget-main-split input:focus,
    #budget-main-split select:focus,
    #budget-main-split textarea:focus {
        background: #ffffff !important;
        border: 1px solid var(--primary-color) !important;
        box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1) !important;
    }
    #budget-main-split textarea {
        padding: 0.8rem !important;
        height: 70px !important;
    }
    /* Redundant inline attribute styles refactored to .contact-info-card */

    /* --- Spec Selection (Style Cards) Mobile Optimization --- */
    #budget-styles-container label {
        font-size: var(--font-size-h2) !important;
        margin-bottom: 0.6rem !important;
        color: #334155 !important;
    }
    #budget-styles-list {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        gap: 0.6rem !important;
        padding-bottom: 0.8rem !important;
        -webkit-overflow-scrolling: touch !important;
        scroll-snap-type: x mandatory;
    }
    #budget-styles-list::-webkit-scrollbar {
        height: 4px !important;
    }
    #budget-styles-list::-webkit-scrollbar-thumb {
        background: #cbd5e1 !important;
        border-radius: 10px !important;
    }
    #budget-styles-list .style-card {
        flex: 0 0 auto !important;
        width: 105px !important;
        scroll-snap-align: start;
    }
    #budget-styles-container label::after {
        content: " (可多选，左右滑动查看更多)" !important;
        font-size: 0.75rem !important;
        color: #94a3b8 !important;
        font-weight: normal !important;
    }
    #budget-styles-list .style-card {
        padding: 0.5rem !important;
        border-radius: 12px !important;
        border-width: 1.5px !important;
    }
    #budget-styles-list .style-card > div:first-child {
        margin-bottom: 0.4rem !important;
        border-radius: 8px !important;
    }
    #budget-styles-list .style-card > div:first-child > div {
        width: 20px !important;
        height: 20px !important;
        font-size: 0.6rem !important;
        top: 4px !important;
        right: 4px !important;
    }
    #budget-styles-list .style-name {
        font-size: 0.85rem !important;
        font-weight: 700 !important;
    }

    #budget-main-split div[style*="background: #f9fbfd"] > div:first-child {
        font-size: 0.95rem !important;
        margin-bottom: 0.8rem !important;
        color: #64748b !important;
    }
}

/* --- Global Spec Selection Horizontal Scroll (PC) --- */
@media (min-width: 769px) {
    #budget-styles-list {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        gap: 1rem !important;
        padding-bottom: 1rem !important;
        -webkit-overflow-scrolling: touch !important;
    }
    #budget-styles-list::-webkit-scrollbar {
        height: 8px !important;
    }
    #budget-styles-list::-webkit-scrollbar-thumb {
        background: #cbd5e1 !important;
        border-radius: 10px !important;
    }
    #budget-styles-list::-webkit-scrollbar-thumb:hover {
        background: #94a3b8 !important;
    }
    #budget-styles-list .style-card {
        flex: 0 0 auto !important;
        width: 140px !important;
    }
    #budget-styles-container label::after {
        content: " (可多选，左右滑动查看更多)" !important;
        font-size: 0.9rem !important;
        color: #94a3b8 !important;
        font-weight: normal !important;
        margin-left: 0.5rem !important;
    }
}

/* Modern Form Focus & Placeholder Styles */
#budget-form-container input,
#budget-form-container select,
#budget-form-container textarea {
    transition: all 0.3s ease;
}
#budget-form-container input:focus,
#budget-form-container select:focus,
#budget-form-container textarea:focus {
    outline: none !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(65, 184, 131, 0.15) !important;
    background-color: #fff !important;
}
#budget-form-container input::placeholder,
#budget-form-container textarea::placeholder {
    color: #cbd5e1 !important;
    font-weight: 400 !important;
}

/* Responsive Form Grids */
.responsive-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.responsive-grid-contact {
    display: grid;
    grid-template-columns: 1fr 1.2fr !important;
    gap: 0.8rem;
}
.responsive-grid-time {
    display: grid;
    grid-template-columns: 1.3fr 1fr !important;
    gap: 0.8rem;
}
@media (max-width: 768px) {
    .order-amount-cell {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
    }
    .order-amount-cell .amt-label-pc {
        font-size: 0.85rem !important;
    }
    .responsive-grid-2 {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.6rem !important;
    }
    #budget-form-container label {
        font-size: var(--font-size-label) !important;
        line-height: 1.3;
    }
}

/* =========================================
   ADMIN HEADER BAR - RESPONSIVE LAYOUT
   ========================================= */

/* 桌面基础样式 */
.admin-header-bar {
    background: var(--bg-light);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-sizing: border-box;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    height: 60px;
}

.admin-header-top {
    display: flex;
    align-items: center;
    width: 100%;
    flex: 1;
    /* logo 靠左，actions 靠右 */
}

.admin-logo-wrap {
    display: flex;
    align-items: center;
    flex-shrink: 0;   /* logo 不被压缩 */
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;   /* 强制靠右 */
}

.admin-user-info {
    font-size: 0.85rem;
    color: #64748b;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: color 0.2s;
    gap: 0.4rem;
}

.admin-header-divider {
    width: 1px;
    height: 14px;
    background: #cbd5e1;
    flex-shrink: 0;
}

/* 铃铛按钮容器 */
.push-toggle-btn {
    font-size: 0.75rem;
    color: #64748b;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 0.3rem;
    padding: 3px 6px;
    border-radius: 6px;
    background: rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
}

/* 铃铛图标容器（用于叠加斜线） */
.bell-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* 斜线：关闭状态显示 */
.bell-icon-wrap::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 2px;
    background: #94a3b8;
    transform: translate(-50%, -50%) rotate(-45deg);
    border-radius: 1px;
    transition: opacity 0.2s;
    opacity: 1;
}

/* 开启状态：隐藏斜线 */
.push-toggle-btn.push-on .bell-icon-wrap::after {
    opacity: 0;
}

/* 开启状态：粉绿色/粉蓝色 */
.push-toggle-btn.push-on {
    background: #ebfbfc;
    border-color: #2DCCD3;
    color: #078e93;
}
.push-toggle-btn.push-on #push-bell-icon {
    stroke: #078e93;
}

/* 关闭状态：灰色 */
.push-toggle-btn.push-off {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.05);
    color: #94a3b8;
}
.push-toggle-btn.push-off #push-bell-icon {
    stroke: #94a3b8;
}

.admin-header-link {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    transition: color 0.2s;
}

/* 桌面：导航栏绝对居中 */
.admin-header-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: auto;
}


/* =========================================
   手机响应式：<= 820px
   ========================================= */
@media (max-width: 820px) {
    /* ---- header 两行布局 ---- */
    .admin-header-bar {
        flex-direction: column;
        align-items: stretch !important; /* 强制拉伸第一行与第二行以填满宽度 */
        height: auto;
        padding: 0;
        gap: 0;
        position: sticky;
        top: 0;
    }

    /* 第一行：Logo 左 | 操作按钮右 */
    .admin-header-top {
        display: flex !important; /* 确保是 flex 容器 */
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between !important; /* 强制 Logo 居左，操作按钮居右 */
        padding: 0.4rem 0.75rem;
        box-sizing: border-box;
    }

    /* Logo 手机缩小 */
    .admin-logo-wrap > div {
        padding: 0.3rem 0.8rem !important;
    }
    .admin-logo-wrap > div > div {
        font-size: 1.25rem !important;
    }

    /* 右侧操作区 — 强制靠右 */
    .admin-header-actions {
        display: flex;
        align-items: center;
        gap: 0.2rem;         /* 缩小按钮之间的间距，从 0.3rem 改为 0.2rem */
        flex-shrink: 0;
        margin-left: auto;   /* 确保靠右 */
    }

    /* 隐藏桌面分隔线 */
    .admin-header-divider {
        display: none;
    }

    /* 用户图标：只显示图标，隐藏文字 */
    .admin-user-info {
        padding: 5px;        /* 减少内边距 */
        min-width: 30px;     /* 从 32px 减小到 30px */
        min-height: 30px;    /* 从 32px 减小到 30px */
        justify-content: center;
    }
    #user-display-name {
        display: none;   /* 手机隐藏用户名 */
    }

    /* 通知按钮：只显示铃铛图标，隐藏文字 */
    .push-toggle-btn {
        padding: 5px 6px;    /* 减少内边距 */
        min-height: 30px;    /* 从 34px 减小到 30px */
        border-radius: 6px;  /* 从 8px 减至 6px */
        gap: 0.15rem;        /* 从 0.2rem 减至 0.15rem */
    }
    #push-status-text {
        display: none;   /* 手机隐藏通知状态文字 */
    }

    /* 我要点单 / 退出 — 图标 + 文字，更紧凑的点击区域 */
    .admin-header-link {
        font-size: 0.72rem;  /* 减小字号，从 0.78rem 到 0.72rem */
        padding: 5px 7px;    /* 缩小内边距，从 6px 9px 减至 5px 7px */
        min-height: 30px;    /* 从 34px 减小到 30px */
        justify-content: center;
        border-radius: 6px;  /* 从 8px 减至 6px */
        background: rgba(0,0,0,0.04);
        border: 1px solid rgba(0,0,0,0.08);
        gap: 0.15rem;        /* 从 0.2rem 减至 0.15rem */
    }
    .admin-header-link span {
        display: inline;
        font-size: 0.68rem;  /* 减小文本字号，从 0.73rem 到 0.68rem */
    }

    /* 第二行：导航标签，横向滚动 */
    .admin-header-nav {
        position: static;
        transform: none;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        border-top: 1px solid var(--glass-border);
        display: flex;
        justify-content: flex-start;
        padding: 0 0.5rem;
        box-sizing: border-box;
    }
    .admin-header-nav::-webkit-scrollbar {
        display: none;
    }

    /* tab 按钮 */
    .admin-header-nav .role-tabs {
        display: flex;
        width: max-content;
    }
    .admin-header-nav .role-btn {
        font-size: 0.92rem !important;
        padding: 0.45rem 0.85rem !important;
        white-space: nowrap;
        min-height: 38px;
    }
}

/* 超小屏（≤520px）：连「我要点单」「退出」也只保留图标，提供更充裕的布局空间 */
@media (max-width: 520px) {
    .admin-header-link span {
        display: none;
    }
    .admin-header-link {
        padding: 6px;
        min-width: 30px;
    }
}



/* =========================================
   GOLDEN BREATHE GLOW ANIMATION FOR NEW ORDERS
   ========================================= */
@keyframes goldenBreathe {
    0% { box-shadow: 0 0 5px rgba(217, 119, 6, 0.2), inset 0 0 5px rgba(217, 119, 6, 0.1); }
    50% { box-shadow: 0 0 25px rgba(217, 119, 6, 0.7), inset 0 0 12px rgba(217, 119, 6, 0.4); border-color: #d97706; }
    100% { box-shadow: 0 0 5px rgba(217, 119, 6, 0.2), inset 0 0 5px rgba(217, 119, 6, 0.1); }
}
.golden-breathe-glow {
    animation: goldenBreathe 1.8s ease-in-out infinite;
    border: 2px solid #d97706 !important;
    transition: border-color 0.5s ease, box-shadow 0.5s ease;
}

/* =========================================
   PREMIUM MINIMALIST BRAND LOGO DESIGN
   ========================================= */
.brand-logo-pill {
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center !important;
    transform: none !important;
    cursor: pointer;
    transition: all 0.2s ease;
}
.brand-logo-pill:hover {
    transform: none !important;
    opacity: 0.8;
}
.brand-logo-text {
    font-family: 'Times New Roman', Times, serif;
    font-style: italic !important;
    font-weight: 700; /* Sophisticated bold weight */
    font-size: 1.65rem;
    color: #857874 !important; /* Pantone 409C */
    letter-spacing: -0.3px;
    transform: none !important;
    line-height: 1;
    display: flex;
    align-items: center;
}
.brand-logo-badge-wrap {
    display: inline-flex !important;
    align-items: flex-start !important;
    margin-left: 7px !important;
    position: relative !important;
    vertical-align: middle !important;
}
.brand-logo-sub {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem !important;
    margin-left: 0 !important;
    background: #FFED00 !important;
    color: #0f172a !important;
    padding: 3.5px 7px !important;
    border-radius: 5px !important;
    font-weight: 800 !important;
    font-style: normal !important;
    box-shadow: 0 2px 6px rgba(255, 237, 0, 0.3) !important;
    transform: skewX(-15deg) !important;
    display: inline-flex !important;
    align-items: center !important;
    line-height: 1 !important;
    letter-spacing: 0.5px !important;
    border: none !important;
}
.brand-logo-jls {
    font-family: 'Inter', sans-serif !important;
    font-size: 0.62rem !important;
    font-weight: 700 !important;
    font-style: normal !important;
    color: #857874 !important; /* Pantone 409C */
    margin-top: -4px !important; /* Shift JLS above the top line */
    margin-left: 4px !important;
    letter-spacing: 0.8px !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
}
.header-logo-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

/* Mobile responsive styling for Logo */
@media (max-width: 820px) {
    .brand-logo-text {
        font-size: 1.62rem !important;
        letter-spacing: -0.2px !important;
    }
    .brand-logo-badge-wrap {
        margin-left: 6px !important;
    }
    .brand-logo-sub {
        font-size: 0.7rem !important;
        margin-left: 0 !important;
        padding: 2.5px 5.5px !important;
    }
    .brand-logo-sub-img {
        height: 13px !important;
        margin: 0 !important;
    }
    .brand-logo-jls {
        font-size: 0.52rem !important;
        margin-left: 3px !important;
        margin-top: -3px !important;
    }
}

#budget-title {
    font-family: 'Inter', sans-serif !important;
    font-size: var(--font-size-h1) !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    letter-spacing: -0.5px !important;
}

/* =========================================
   PREMIUM UNIFIED FORM TYPOGRAPHY SYSTEM
   ========================================= */

/* Modal Header Main Titles */
.modal-header-title {
    font-size: var(--font-size-h1) !important;
    font-weight: 900 !important;
    color: #0f172a !important;
    margin: 0 !important;
    letter-spacing: -0.5px !important;
}

/* Main form section headers */
.form-section-title {
    font-size: var(--font-size-h2) !important;
    font-weight: 700 !important;
    display: block !important;
    color: #0f172a !important;
    margin-bottom: 0.6rem !important;
    letter-spacing: -0.3px !important;
}

/* Form input field labels (Unified to be 1 size larger than input) */
.form-field-label {
    display: flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    font-size: var(--font-size-label) !important;
    font-weight: 600 !important;
    color: #475569 !important; /* Elegant Muted Slate-600 */
    margin-bottom: 0.15rem !important;
}

.label-icon {
    width: 14px !important;
    height: 14px !important;
    stroke: #64748b !important;
    stroke-width: 2.2px !important;
    display: inline-block !important;
    vertical-align: -2px !important;
    margin-right: 2px !important;
    flex-shrink: 0 !important;
}

/* English descriptions inside labels */
.form-field-label span:last-child {
    font-size: var(--font-size-sub) !important;
    font-weight: 500 !important;
    color: #94a3b8 !important;
    margin-left: 0.35rem !important;
}

/* Form input/select/textarea fields (Fully unified size) */
.form-field-input {
    height: 42px !important;
    border-radius: 12px !important;
    font-size: var(--font-size-input) !important;
    padding: 0 0.8rem !important;
    border: 1px solid #cbd5e1 !important;
    font-weight: 500 !important;
    color: #1e293b !important;
    background: #fafafa !important;
    width: 100% !important;
    box-sizing: border-box !important;
    transition: all 0.2s ease !important;
    outline: none !important;
}
.form-field-input:focus {
    border-color: var(--primary-color) !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}
textarea.form-field-input {
    height: auto !important;
    padding: 0.8rem 1rem !important;
}

/* Date and Time custom trigger buttons */
.contact-info-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-top: 0.5rem !important;
    border-top: 1px dashed #e2e8f0 !important;
    padding-top: 0.5rem !important;
}

#budget-form-container .glass-card > div {
    gap: 0.55rem !important;
}

.form-trigger-btn {
    width: 100% !important;
    padding: 0.5rem 0.8rem !important;
    border-radius: 12px !important;
    border: 1px solid #cbd5e1 !important;
    font-size: var(--font-size-sub) !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    background: white !important;
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 42px !important;
    box-sizing: border-box !important;
    position: relative !important;
    overflow: hidden !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}
.form-trigger-btn:hover {
    border-color: var(--primary-color) !important;
    background: #fafafa !important;
}

/* Primary submit requirements button */
.btn-submit-order {
    width: 100% !important;
    height: 50px !important;
    border-radius: 14px !important;
    font-weight: 800 !important;
    font-size: var(--font-size-label) !important;
    margin-top: 0px !important;
    background: linear-gradient(135deg, var(--primary-color), #1FA3A9) !important;
    box-shadow: 0 6px 16px rgba(45, 204, 211, 0.25) !important;
    transition: all 0.2s ease !important;
    color: #fff !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.btn-submit-order:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 8px 20px rgba(45, 204, 211, 0.35) !important;
}
.btn-submit-order:active {
    transform: translateY(0) !important;
}

/* Mobile adjustments */
@media (max-width: 820px) {
    /* Responsive Scale Overrides */
    :root {
        --font-size-h1: 1.22rem;     /* ~19.5px */
        --font-size-h2: 1.05rem;     /* ~16.8px */
        --font-size-label: 1.05rem;  /* ~16.8px - Form Field Labels (Same size as card headers on mobile) */
        --font-size-input: 1.05rem;  /* ~16.8px - Input text, options, triggers */
        --font-size-sub: 0.8rem;     /* ~12.8px - Sub-labels and trigger buttons */
        --font-size-tiny: 0.72rem;   /* ~11.5px - Badges and small subtext */
    }

    .form-field-input, .form-trigger-btn {
        height: 38px !important;
        min-height: 38px !important;
        border-radius: 10px !important;
    }
    .btn-submit-order {
        height: 42px !important;
        border-radius: 10px !important;
        margin-top: 0px !important;
        font-size: var(--font-size-label) !important; /* Unified with form field label size on mobile */
    }
}


.trigger-val.placeholder-state {
    color: #94a3b8 !important;
    font-weight: 500 !important;
}

/* ==========================================
   Order Progress Stepper Component Styles
   ========================================== */
.order-progress-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 380px;
    margin: 0 auto;
    position: relative;
    padding: 8px 0;
}

.order-progress-bg-track {
    position: absolute;
    top: 17px;
    left: 16.666%;
    right: 16.666%;
    height: 4px;
    background: #e2e8f0;
    z-index: 1;
    border-radius: 2px;
}

.order-progress-active-track {
    position: absolute;
    top: 17px;
    left: 16.666%;
    height: 4px;
    background: #2DCCD3;
    z-index: 2;
    transition: width 0.4s ease;
    border-radius: 2px;
}

.order-progress-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 3;
    position: relative;
}

.order-progress-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transform: scale(1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.order-progress-dot.active {
    background: #2DCCD3;
    border: 4px solid #fff;
    box-shadow: 0 0 0 4px rgba(45,204,211,0.25), 0 0 10px rgba(45,204,211,0.5);
    transform: scale(1.35);
}

.order-progress-dot.passed {
    background: #2DCCD3;
    border: 3px solid #2DCCD3;
}

.order-progress-label {
    margin-top: 6px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 0.78rem;
    font-weight: 600;
    color: #94a3b8;
    opacity: 1;
}

.order-progress-label.active {
    color: #FF6C38;
    font-weight: 700;
    font-size: 0.78rem;
}

.order-progress-label.passed {
    color: #64748b;
    font-weight: 600;
    opacity: 0.65;
}

/* Mobile responsive stepper overrides */
@media (max-width: 768px) {
    .order-progress-container {
        width: 100% !important;
        max-width: 330px !important;
        box-sizing: border-box !important;
    }
    
    .order-progress-label {
        font-size: 0.72rem;
    }
    
    .order-progress-label.active {
        font-size: 0.72rem !important; /* Keep same size as other labels on mobile */
    }
}

/* Autocomplete Dropdown Indicator */
.batch-row-dept {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
    background-size: 14px !important;
    padding-right: 28px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
}
.batch-row-dept::-webkit-calendar-picker-indicator {
    opacity: 0 !important;
    cursor: pointer !important;
    width: 28px !important;
    height: 100% !important;
}

/* Custom Autocomplete styles */
.custom-dropdown-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.85rem;
    color: #334155;
    transition: background 0.15s;
    user-select: none;
}
.custom-dropdown-item:hover {
    background-color: #f1f5f9 !important;
}
.custom-dropdown-item:active {
    background-color: #e2e8f0 !important;
}


/* Responsive Overrides for Offline Order Entry on Mobile */
@media (max-width: 600px) {
    #off-single-entry-fields {
        grid-template-columns: 1fr !important;
        gap: 0.8rem !important;
    }
    .modal-body {
        padding: 1rem 1.25rem !important;
    }
    .modal-header {
        padding: 1rem 1.25rem !important;
    }
    .modal-footer {
        padding: 0.8rem 1.25rem !important;
        padding-bottom: max(0.8rem, env(safe-area-inset-bottom)) !important;
    }
}
@media (max-width: 768px) {
    input, select, textarea {
        font-size: 16px !important;
    }
    .batch-row-date, .batch-row-dept, .batch-row-amount, .batch-row-remarks {
        height: 36px !important;
        font-size: 16px !important;
    }
}

/* Monthly Bills Modal Responsive Styles */
.monthly-bills-totals-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    background: #fafbfc;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1rem;
}
.monthly-bills-totals-grid > div {
    text-align: center;
}
.monthly-bills-totals-grid > div:not(:last-child) {
    border-right: 1px solid #e9ecef;
}

.monthly-bills-filter-group {
    display: flex;
    gap: 8px;
    margin-bottom: 1.25rem;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 8px;
    width: fit-content;
    border: 1px solid #e2e8f0;
}
.mb-filter-btn {
    border: none;
    background: transparent;
    color: #64748b;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.mb-filter-btn.active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

@media (max-width: 600px) {
    .monthly-bills-totals-grid {
        grid-template-columns: repeat(3, 1fr) !important; /* Keep horizontal */
        gap: 0.25rem !important;
        padding: 0.5rem 0.25rem !important;
    }
    .monthly-bills-totals-grid > div:not(:last-child) {
        border-right: 1px solid #e9ecef !important; /* Keep vertical divider */
        border-bottom: none !important;
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
    }
    .monthly-bills-totals-grid .metric-label {
        font-size: 0.58rem !important; /* Shrink label font size */
        margin-bottom: 0.15rem !important;
    }
    .monthly-bills-totals-grid .metric-value {
        font-size: 0.8rem !important; /* Shrink amount font size */
    }
    .monthly-bills-filter-group {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 4px !important;
    }
    .monthly-bills-filter-group .mb-filter-btn {
        padding: 6px 4px !important;
        font-size: 0.75rem !important;
        text-align: center !important;
    }
}

/* User Registration Permission Labels - Keep Horizontal & Wrap Neatly */
#user-form-glass-card label {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

/* --- Mobile Responsiveness Overrides --- */
@media (max-width: 600px) {
    /* Sub-tabs navigation flex wrapping */
    .sub-tabs-nav {
        flex-wrap: wrap !important;
        gap: 0.4rem !important;
    }
    .sub-tabs-nav .sub-tab-btn {
        flex: 1 1 calc(50% - 0.4rem) !important;
        text-align: center !important;
        font-size: 0.75rem !important;
        padding: 0.5rem 0.3rem !important;
        justify-content: center !important;
    }

    /* User registration form header stacking */
    .user-form-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
    }
    .user-form-header h3 {
        font-size: 1rem !important;
        border-bottom: 1px solid #f1f5f9;
        padding-bottom: 0.5rem;
    }
    .user-form-permissions {
        width: 100% !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        justify-content: flex-start !important;
    }
    
    /* Ensure the labels inside permissions look like premium tags and wrap cleanly */
    .user-form-permissions label {
        flex: 1 0 calc(33.33% - 0.5rem) !important;
        min-width: 80px !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        font-size: 0.7rem !important;
        padding: 0.4rem 0.5rem !important;
    }
    
    @media (max-width: 400px) {
        .user-form-permissions label {
            flex: 1 0 calc(50% - 0.5rem) !important;
        }
    }

    /* Form Fields stacking */
    .user-form-fields {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.8rem !important;
    }
    .user-form-fields > input,
    .user-form-fields > div {
        width: 100% !important;
        flex: none !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Action Buttons stretch */
    .user-form-actions {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    .user-form-actions button {
        width: 100% !important;
        padding: 0.6rem !important;
    }

    /* Hide filter dividers and gridify filters array */
    .admin-filters-array {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.6rem !important;
        padding: 0.8rem !important;
        box-sizing: border-box !important;
        width: 100% !important;
    }
    .admin-filters-array .admin-filter-full-width {
        grid-column: span 2 !important;
        width: 100% !important;
    }
    .admin-filters-array .admin-filter-full-width input {
        width: 100% !important;
        max-width: 100% !important;
    }
    .admin-filters-array select {
        width: 100% !important;
        min-width: 0 !important;
    }
    .admin-filters-array .filter-divider {
        display: none !important;
    }

    /* Unified filter bar responsive layout - stretch search input on its own row */
    .filter-bar-row {
        flex-wrap: wrap !important;
        row-gap: 0.5rem !important;
        column-gap: 0.4rem !important;
        padding: 0.5rem 0.75rem !important;
    }
    .filter-bar-search {
        flex: 0 0 100% !important;
        width: 100% !important;
        border-bottom: 1px solid #f1f5f9 !important;
        padding-bottom: 0.4rem !important;
        margin-bottom: 0.1rem !important;
    }
    .filter-bar-search input {
        font-size: 0.88rem !important;
    }
    .filter-bar-divider-ym {
        display: none !important;
    }

    /* Category explorer split layout stacking */
    .category-explorer-container {
        flex-direction: column !important;
        height: auto !important;
    }
    .category-explorer-left {
        width: 100% !important;
        height: 250px !important; /* scrollable height for list navigation */
        border-bottom: 2px solid #eee !important;
    }
    .category-explorer-right {
        width: 100% !important;
        padding: 1.2rem !important;
        height: auto !important;
    }
}
