/* 基礎樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2f4059;
    --primary-dark: #233249;
    --primary-light: #d9e0ea;
    --primary-rgb: 47, 64, 89;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --rose-gold: #E8B4B8;
    --rose-gold-dark: #D4AF37;
    --rose-gold-light: #F7CAC9;
    --rose-gold-gradient: linear-gradient(135deg, #F7CAC9 0%, #E8B4B8 50%, #D4AF37 100%);
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-hover: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-lg: rgba(0, 0, 0, 0.15);
    --sakura-50: #fff5f8;
    --sakura-100: #ffe9f1;
    --sakura-200: #f9d2e3;
    --sakura-300: #f5bfd6;
    --sakura-400: #f0a7c4;
    --sakura-500: #ec8cb1;
    --sakura-glow: rgba(236, 140, 177, 0.18);
    --sakura-gradient: linear-gradient(135deg, #ffeef4 0%, #f9dbe7 50%, #f5c1d6 100%);
    --logo-edge: rgba(232, 180, 184, 0.14);
    --logo-glow: rgba(232, 180, 184, 0.1);
    --logo-inset: rgba(248, 250, 252, 0.12);
}

/* 深色主題 */
[data-theme="dark"] {
    --primary: #3a4c66;
    --primary-dark: #2c3b52;
    --primary-light: #2a3546;
    --primary-rgb: 58, 76, 102;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --rose-gold: #E8B4B8;
    --rose-gold-dark: #D4AF37;
    --rose-gold-light: #F7CAC9;
    --rose-gold-gradient: linear-gradient(135deg, #F7CAC9 0%, #E8B4B8 50%, #D4AF37 100%);
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-hover: #475569;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #475569;
    --border-light: #334155;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.5);
    --logo-edge: rgba(232, 180, 184, 0.2);
    --logo-glow: rgba(232, 180, 184, 0.12);
    --logo-inset: rgba(255, 255, 255, 0.04);
}

/* 淺色主題：櫻花點綴 */
html:not([data-theme="dark"]) body {
    background: linear-gradient(180deg, var(--sakura-50) 0%, #f8fafc 45%, #f7f9fc 100%);
}

html:not([data-theme="dark"]) .main-content {
    background: radial-gradient(circle at top right, rgba(236, 140, 177, 0.08), transparent 42%),
        radial-gradient(circle at 12% 20%, rgba(240, 167, 196, 0.12), transparent 40%),
        var(--bg-primary);
}

html:not([data-theme="dark"]) .card,
html:not([data-theme="dark"]) .dashboard-card {
    border-color: #f5dbe6;
    box-shadow: 0 8px 24px rgba(236, 140, 177, 0.08), 0 2px 8px var(--shadow);
}

html:not([data-theme="dark"]) .card::before,
html:not([data-theme="dark"]) .dashboard-card::before,
html:not([data-theme="dark"]) .card::after,
html:not([data-theme="dark"]) .dashboard-card::after {
    background: var(--sakura-gradient);
    opacity: 0.5;
}

html:not([data-theme="dark"]) .page-header h1 {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

html:not([data-theme="dark"]) .page-header h1::after {
    content: '';
    width: 40px;
    height: 6px;
    border-radius: 999px;
    background: var(--sakura-gradient);
    opacity: 0.6;
}

/* 科技感字體設定 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Sans+TC:wght@400;500;600;700&display=swap');

body {
    font-family: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    font-weight: 500;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* 登入頁面 */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(circle at top, #1f2937 0%, #0b1220 55%, #080c16 100%);
    transition: background 0.3s ease;
}

[data-theme="dark"] .login-page {
    background: radial-gradient(circle at top, #1b2332 0%, #0b1220 55%, #080c16 100%);
}

[data-theme="dark"] .login-box {
    background: rgba(12, 18, 32, 0.92);
    border: 1px solid rgba(212, 175, 55, 0.5);
}

[data-theme="dark"] .login-box h1 {
    color: var(--text-primary);
}

[data-theme="dark"] .login-subtitle {
    color: var(--text-secondary);
}

.login-theme-toggle {
    position: absolute;
    top: -56px;
    right: clamp(12px, 3.5vw, 20px);
    z-index: 2;
}

.login-theme-toggle .icon-btn {
    width: 44px;
    height: 44px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.4);
}

[data-theme="dark"] .login-theme-toggle .icon-btn {
    background: rgba(15, 23, 42, 0.85);
}

@media (max-width: 768px) {
    .login-theme-toggle {
        top: -50px;
        right: max(12px, calc(env(safe-area-inset-right, 0px) + 10px));
        z-index: 2;
    }

    .login-theme-toggle .icon-btn {
        width: 40px;
        height: 40px;
    }

}

@media (max-width: 420px) {
    .login-theme-toggle {
        right: max(14px, calc(env(safe-area-inset-right, 0px) + 12px));
    }
}

.login-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    padding: 20px;
    margin-top: 56px;
}

.login-box {
    background: rgba(12, 18, 32, 0.92);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(3, 7, 18, 0.6);
    border: 1px solid rgba(212, 175, 55, 0.6);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 10px;
    color: #f8fafc;
    letter-spacing: 0.08em;
}

.login-subtitle {
    text-align: center;
    color: #d4af37;
    margin-bottom: 30px;
    letter-spacing: 0.04em;
}

.login-note {
    margin-top: 20px;
    font-size: 12px;
    color: rgba(248, 250, 252, 0.7);
    text-align: center;
}

.login-box label {
    color: rgba(248, 250, 252, 0.85);
}

.login-box input {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: #f8fafc;
}

.login-box input:focus {
    border-color: rgba(212, 175, 55, 0.75);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.login-page .btn-primary {
    background: linear-gradient(135deg, #2f4059 0%, #223047 100%);
    color: #ffffff;
    border: 1px solid rgba(212, 175, 55, 0.35);
    box-shadow: 0 6px 16px rgba(34, 48, 71, 0.35);
}

.login-page .btn-primary:hover {
    background: linear-gradient(135deg, #3a4c66 0%, #293a55 100%);
}

/* 表單樣式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.01em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.01em;
    transition: all 0.2s;
    font-family: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: var(--primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* 按鈕樣式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    font-family: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    transition: all 0.3s;
    background: var(--primary);
    color: #ffffff;
    border: 1px solid var(--primary);
}

.btn:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-compact {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 30px;
    border-radius: 6px;
}

/* 操作按鈕組 */
.action-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.action-buttons .btn-sm {
    padding: 10px 18px;
    min-width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.action-buttons .btn-sm span {
    font-size: 16px;
    line-height: 1;
    font-weight: 600;
}

/* 退貨資訊顯示 */
.return-original-info {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
}

.return-info-item {
    padding: 4px 0;
    font-size: 14px;
    color: var(--text-primary);
}

.return-info-item strong {
    color: var(--text-secondary);
    margin-right: 8px;
}

.btn-danger {
    background: var(--primary);
    color: #ffffff;
}

.btn-danger:hover {
    background: var(--primary-dark);
    color: #ffffff;
}

.btn-success {
    background: var(--primary);
    color: #ffffff;
}

/* 淺色主題：月結帳單已撥款按鈕維持綠色 */
.btn-paid {
    background: #16a34a;
    color: #ffffff;
    border: 1px solid #16a34a;
}

.btn-paid:hover {
    background: #15803d;
    border-color: #15803d;
}

.btn-paid:disabled {
    opacity: 0.85;
    cursor: not-allowed;
}

/* 深色主題按鈕文字顏色 */
[data-theme="dark"] .btn {
    color: white;
}

[data-theme="dark"] .btn-primary {
    color: white;
}

[data-theme="dark"] .btn-danger {
    background: var(--danger);
    color: white;
}

[data-theme="dark"] .btn-success {
    background: var(--success);
    color: white;
}

[data-theme="dark"] .btn-paid {
    background: var(--success);
    color: white;
}

[data-theme="dark"] .btn-paid:hover {
    background: #059669;
}

[data-theme="dark"] .btn-danger:hover {
    background: #dc2626;
}

[data-theme="dark"] .btn-success:hover {
    background: #059669;
}

[data-theme="dark"] .btn:not(.btn-primary):not(.btn-danger):not(.btn-success) {
    color: white;
    background: var(--bg-tertiary);
}

[data-theme="dark"] .btn:not(.btn-primary):not(.btn-danger):not(.btn-success):hover {
    color: white;
    background: var(--bg-hover);
}

.error-message {
    background: #fee2e2;
    border: 1px solid var(--danger);
    color: #991b1b;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
}

/* 主要佈局：高度 h-24 (96px)，讓 LOGO 與發光有足夠空間，不壓到側邊欄選單 */
.header {
    background: var(--bg-secondary);
    padding: 12px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid;
    border-image: linear-gradient(90deg, transparent, var(--rose-gold-light), var(--rose-gold), var(--rose-gold-light), transparent) 1;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 
        0 2px 4px var(--shadow),
        0 0 20px rgba(232, 180, 184, 0.1);
    min-height: 96px;
    max-height: 96px;
    overflow: visible;   /* 允許搜尋下拉結果完整展開，避免被 header 底線裁切 */
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    max-width: 420px;
}

.mobile-menu-btn {
    display: none;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.mobile-menu-btn:hover {
    background: var(--bg-tertiary);
}

.floating-menu-btn {
    display: none;
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--primary);
    color: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.25);
    z-index: 1002;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .floating-menu-btn {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    max-width: 100%;
}

.logo-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 50%, #2563eb 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 
        0 8px 24px rgba(59, 130, 246, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2),
        0 0 0 2px var(--rose-gold-light);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.logo-icon::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--rose-gold-gradient);
    border-radius: 16px;
    z-index: -1;
    opacity: 0.6;
    filter: blur(4px);
}

.logo-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: logoRotate 4s infinite;
}

@keyframes logoRotate {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.logo-icon:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 12px 32px rgba(59, 130, 246, 0.5),
        0 6px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.logo-icon svg,
.logo-icon img.main-logo {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
    object-fit: contain;
}

.logo-icon svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.logo-icon img.main-logo {
    border-radius: 12px;
}

/* TRIP POINT logo：背景透明、無邊框無陰影，與背景融合 */
.logo-icon.logo-icon-animated {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    animation: logoFloat 3s ease-in-out infinite;
}

.logo-icon.logo-icon-animated::before,
.logo-icon.logo-icon-animated::after {
    display: none;
}

.logo-icon.logo-icon-animated .main-logo {
    animation: none;
    filter: none;
}

/* 滿版 logo：容器完全透明、長方形圓弧邊角，overflow visible 保留光暈動畫 */
.logo-icon.logo-icon-fullbleed {
    height: 80px;       /* h-20，可改為 96px (h-24) */
    max-height: 96px;
    width: auto;
    min-width: 100px;
    max-width: 100%;
    flex-shrink: 0;
    border-radius: 12px;   /* 長方形圓弧邊角 */
    overflow: visible;
    position: relative;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* 圖片：mix-blend-screen 濾掉深色、只留發光，drop-shadow 增強光暈，圓角與容器一致 */
.logo-icon.logo-icon-fullbleed .main-logo {
    height: 100%;
    max-height: 80px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    border: none;
    border-radius: 12px;
    box-shadow: none;
    mix-blend-mode: screen;
    filter: drop-shadow(0 0 8px rgba(0, 200, 255, 0.5));
}

/* 飛機運行動畫：繞 logo 區域飛行 */
.logo-plane {
    position: absolute;
    top: 50%;
    left: 50%;
    --orbit-radius: 46px;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    color: rgba(34, 211, 238, 0.95);
    filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.8));
    z-index: 2;
    offset-path: circle(var(--orbit-radius) at 50% 50%);
    offset-distance: 0%;
    offset-rotate: auto 90deg;
    animation: airplaneOrbit 4.8s linear infinite;
    transform-origin: center center;
    pointer-events: none;
}

.logo-plane .plane-svg {
    width: 100%;
    height: 100%;
    display: block;
}

@keyframes airplaneOrbit {
    0% {
        offset-distance: 0%;
        opacity: 0.95;
    }
    100% {
        offset-distance: 100%;
        opacity: 0.95;
    }
}

/* TRIP POINT 打字機效果 */
.logo-title.typewriter-text {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid rgba(34, 211, 238, 0.9);
    width: 0;
    animation: typewriter 2.8s steps(10) 0.3s forwards, blink 0.7s step-end infinite 3.2s;
    max-width: 100%;
    background: linear-gradient(135deg, #67e8f9 0%, #22d3ee 50%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-title.typewriter-text::after {
    content: none;
    display: none;
}

@keyframes typewriter {
    to { width: 10ch; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

@keyframes logoGlowPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(34, 211, 238, 0.4), 0 0 40px rgba(6, 182, 212, 0.2); }
    50% { box-shadow: 0 0 28px rgba(34, 211, 238, 0.65), 0 0 50px rgba(6, 182, 212, 0.35); }
}

.logo-icon video.main-logo.logo-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: relative;
    z-index: 1;
    border-radius: 12px;
}

.logo-icon svg.main-logo {
    animation: none;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-3px); }
}

/* 深色主題LOGO */
[data-theme="dark"] .logo-icon {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 50%, #2563eb 100%);
    box-shadow: 
        0 8px 24px rgba(74, 144, 226, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(232, 180, 184, 0.3);
}

[data-theme="dark"] .logo-icon.logo-icon-animated {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

[data-theme="dark"] .logo-icon-trip-point {
    background: linear-gradient(145deg, #0e7490 0%, #0891b2 40%, #06b6d4 70%, #22d3ee 100%);
    box-shadow: 
        0 6px 20px rgba(6, 182, 212, 0.5),
        inset 0 2px 0 rgba(255, 255, 255, 0.2),
        inset 0 -2px 0 rgba(0, 0, 0, 0.4),
        0 0 0 2px rgba(34, 211, 238, 0.35);
}

.logo-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
    min-width: 120px;
}

.logo-title {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--rose-gold-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.3;
    letter-spacing: -0.3px;
    position: relative;
}

.logo-title::after {
    content: '全球航空代理';
    position: absolute;
    top: 0;
    left: 0;
    background: linear-gradient(135deg, var(--rose-gold-light) 0%, var(--rose-gold) 50%, var(--rose-gold-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.3;
    z-index: -1;
    filter: blur(1px);
}

.logo-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 0.8px;
    line-height: 1.3;
    font-weight: 500;
    margin-top: 2px;
}

.header-center {
    flex: 1;
    max-width: 400px;
    margin: 0 30px;
}

.search-box {
    position: relative;
    z-index: 1200;
}

.search-results {
    position: absolute;
    top: 44px;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    max-height: 420px;
    overflow-y: auto;
    z-index: 2500;
}

.search-result-section {
    padding: 10px 14px 6px;
    font-size: 12px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.search-result-item {
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: var(--bg-tertiary);
}

.search-result-title {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.search-result-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.header-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-right: 20px;
}

.exchange-rate,
.time,
.bank {
    padding: 8px 16px;
    background: linear-gradient(145deg, #2a2f3d, #1e222d);
    border-radius: 8px;
    color: #ffffff;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.5px;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.exchange-rate::before,
.time::before,
.bank::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent);
    border-radius: 8px 8px 0 0;
    pointer-events: none;
}

.exchange-rate:hover,
.time:hover,
.bank:hover {
    transform: translateY(-1px);
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .exchange-rate,
[data-theme="dark"] .time,
[data-theme="dark"] .bank {
    background: linear-gradient(145deg, #2a2f3d, #1e222d);
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

.exchange-rate {
    background: linear-gradient(145deg, #2a3f5d, #1e2a3d);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.time {
    background: linear-gradient(145deg, #2a3f5d, #1e2a3d);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.bank {
    background: linear-gradient(145deg, #2a3f5d, #1e2a3d);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.header-icons {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 15px;
}

.header-user-profile {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 180px;
}

.header-user-name {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
    position: relative;
}

.icon-btn:hover {
    background: var(--bg-hover);
    transform: scale(1.05);
}

.theme-toggle-btn {
    position: relative;
}

.theme-icon {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.theme-toggle-btn:hover .theme-icon {
    transform: rotate(180deg);
}

.notification-btn {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    box-shadow: 
        0 2px 8px rgba(255, 107, 107, 0.5),
        0 0 0 2px rgba(255, 255, 255, 0.3);
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    z-index: 10;
}

/* 通知 Modal 樣式 */
.notification-modal-content {
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.notification-modal-content .modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 22px;
    cursor: pointer;
}

.notification-modal-content .modal-close:hover {
    color: var(--text-primary);
}

.notification-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.mark-all-read-btn {
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    margin-left: auto;
}

.mark-all-read-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.notification-list {
    overflow-y: auto;
    flex: 1;
    max-height: calc(80vh - 200px);
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.notification-item:hover {
    background: var(--bg-hover);
}

.notification-item.unread {
    background: var(--primary-light);
}

.notification-item.unread:hover {
    background: var(--primary-light);
    opacity: 0.9;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    background: var(--bg-tertiary);
}

.notification-icon.error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

.notification-icon.info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.notification-message {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
}

.notification-time {
    font-size: 12px;
    color: var(--text-muted);
}

.notification-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    margin-top: 6px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.user-avatar.bear-avatar {
    font-size: 18px;
    line-height: 1;
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px var(--shadow);
}

.line-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--success);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* 頁面標籤切換 */
.page-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.page-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    top: 2px;
}

.page-tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.page-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-icon {
    font-size: 16px;
}

.tab-content {
    display: block;
}

/* 角色選擇器 */
.role-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.role-btn {
    padding: 10px 20px;
    border: 2px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.role-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.role-btn.active {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.role-btn[data-role="operator"]:not(.active) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.role-btn[data-role="analyst"]:not(.active) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.role-btn[data-role="billing"]:not(.active) {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}

/* 權限表格 */
.permissions-table-container {
    overflow-x: auto;
}

.permissions-table {
    width: 100%;
    border-collapse: collapse;
}

.permissions-table thead {
    background: var(--bg-tertiary);
}

.permissions-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border);
}

.permissions-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.permissions-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.function-column {
    width: 200px;
    font-weight: 500;
}

.permission-column {
    width: 150px;
    text-align: center;
}

.permission-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.select-all-btn {
    padding: 4px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.select-all-btn:hover {
    background: var(--primary-dark);
}

.permission-checkbox {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: var(--primary);
}

.permission-checkbox:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.header-icon {
    margin-right: 8px;
}

/* 權限說明 */
.permission-description {
    margin-top: 32px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.permission-description h3 {
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 16px;
}

.permission-description ul {
    list-style: none;
    padding: 0;
}

.permission-description li {
    padding: 8px 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.permission-description li strong {
    color: var(--text-primary);
}

/* 權限操作按鈕 */
.permission-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
}

/* 深色主題適配 */
[data-theme="dark"] .role-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] .role-btn.active {
    background: var(--danger);
    color: white;
}

[data-theme="dark"] .permission-description {
    background: var(--bg-tertiary);
    border-left-color: var(--primary);
}

/* 手機與窄平板最終覆寫：航空面板卡片改為由上到下 */
@media (max-width: 1024px) {
    .dashboard-panels-row {
        grid-template-columns: 1fr !important;
    }

    .dashboard-panels-row .airline-mission-grid,
    .airline-mission-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .dashboard-panels-row .airline-mission-card,
    .airline-mission-card {
        min-height: 0;
    }
}

/* 排行榜防擠壓：名稱可收斂、數值不重疊 */
.mission-preview-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mission-preview-mileage {
    justify-self: end;
    white-space: nowrap;
}

/* 手機版：排行榜改為上下資訊流，避免名稱與哩程互壓 */
@media (max-width: 768px) {
    .summary-ranking-preview .mission-preview-item {
        grid-template-columns: 38px minmax(0, 1fr);
        grid-template-areas:
            "rank name"
            "rank mileage";
        align-items: center;
        row-gap: 4px;
    }

    .summary-ranking-preview .mission-preview-rank {
        grid-area: rank;
    }

    .summary-ranking-preview .mission-preview-name {
        grid-area: name;
        font-size: 20px;
        line-height: 1.2;
    }

    .summary-ranking-preview .mission-preview-mileage {
        grid-area: mileage;
        justify-self: start;
        font-size: 16px;
        line-height: 1.2;
    }
}

/* Dashboard + Sidebar (Dark) Cyber HUD theme */
[data-theme="dark"] .dashboard-page {
    background:
        radial-gradient(circle at 14% -10%, rgba(34, 211, 238, 0.22), transparent 36%),
        radial-gradient(circle at 84% -4%, rgba(56, 189, 248, 0.14), transparent 34%),
        radial-gradient(circle at 50% 120%, rgba(14, 165, 233, 0.12), transparent 42%),
        linear-gradient(180deg, #040b18 0%, #060f1d 52%, #071524 100%);
}

[data-theme="dark"] .dashboard-page .header {
    background:
        linear-gradient(180deg, rgba(8, 20, 38, 0.95), rgba(6, 16, 30, 0.92)),
        repeating-linear-gradient(90deg, rgba(56, 189, 248, 0.08) 0, rgba(56, 189, 248, 0.08) 1px, transparent 1px, transparent 42px);
    border-bottom: 1px solid rgba(34, 211, 238, 0.42);
    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.5),
        inset 0 -1px 0 rgba(34, 211, 238, 0.25),
        0 0 22px rgba(34, 211, 238, 0.18);
}

[data-theme="dark"] .sidebar {
    background:
        linear-gradient(180deg, rgba(6, 17, 33, 0.98) 0%, rgba(3, 12, 24, 0.98) 100%),
        repeating-linear-gradient(0deg, rgba(56, 189, 248, 0.06) 0, rgba(56, 189, 248, 0.06) 1px, transparent 1px, transparent 18px);
    border-right: 1px solid rgba(34, 211, 238, 0.36);
    box-shadow:
        10px 0 30px rgba(0, 0, 0, 0.55),
        inset -1px 0 0 rgba(34, 211, 238, 0.25),
        inset 0 0 42px rgba(34, 211, 238, 0.08);
}

[data-theme="dark"] .sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.06) 0%, transparent 40%, rgba(236, 72, 153, 0.05) 100%);
}

[data-theme="dark"] .sidebar-footer {
    background: rgba(5, 16, 30, 0.94);
    border-top: 1px solid rgba(34, 211, 238, 0.24);
}

[data-theme="dark"] .sidebar .nav-item {
    border: 1px solid transparent;
    border-left-width: 3px;
    color: #b6c8dd;
}

[data-theme="dark"] .sidebar .nav-item:hover {
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.18), rgba(34, 211, 238, 0.08));
    border-color: rgba(34, 211, 238, 0.36);
    border-left-color: #22d3ee;
    color: #ecfeff;
    box-shadow: 0 0 14px rgba(34, 211, 238, 0.18);
}

[data-theme="dark"] .sidebar .nav-item.active {
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.24) 0%, rgba(10, 80, 122, 0.2) 64%, rgba(6, 30, 50, 0.35) 100%);
    border-color: rgba(45, 212, 191, 0.45);
    border-left-color: #2dd4bf;
    color: #e0fbff;
    box-shadow:
        0 0 0 1px rgba(45, 212, 191, 0.22),
        0 0 18px rgba(45, 212, 191, 0.28);
}

[data-theme="dark"] .sidebar .nav-icon,
[data-theme="dark"] .sidebar .nav-item.active .nav-icon {
    color: #59f2ff;
    filter: drop-shadow(0 0 5px rgba(34, 211, 238, 0.5));
}

[data-theme="dark"] .dashboard-page .main-content {
    background:
        radial-gradient(circle at 92% 4%, rgba(56, 189, 248, 0.12), transparent 32%),
        radial-gradient(circle at 8% 16%, rgba(34, 211, 238, 0.08), transparent 36%),
        repeating-linear-gradient(90deg, rgba(148, 163, 184, 0.06) 0, rgba(148, 163, 184, 0.06) 1px, transparent 1px, transparent 52px),
        linear-gradient(180deg, #060f1f 0%, #081a2b 100%);
}

[data-theme="dark"] .dashboard-page .dashboard-header h1 {
    color: #f0fbff;
    text-shadow: 0 0 18px rgba(34, 211, 238, 0.32);
}

[data-theme="dark"] .dashboard-page .dashboard-header p {
    color: #6ee7f8;
}

[data-theme="dark"] .dashboard-page .dashboard-card,
[data-theme="dark"] .dashboard-page .stats-grid .stat-card {
    background:
        radial-gradient(circle at 10% 0, rgba(34, 211, 238, 0.14), transparent 44%),
        linear-gradient(160deg, rgba(9, 23, 43, 0.94), rgba(7, 16, 31, 0.96));
    border: 1px solid rgba(34, 211, 238, 0.42);
    box-shadow:
        0 16px 34px rgba(0, 0, 0, 0.42),
        inset 0 0 0 1px rgba(94, 234, 212, 0.14),
        0 0 18px rgba(34, 211, 238, 0.16);
}

[data-theme="dark"] .dashboard-page .dashboard-card h2,
[data-theme="dark"] .dashboard-page .stats-grid .stat-content h3 {
    color: #d9f8ff;
}

[data-theme="dark"] .dashboard-page .stats-grid .stat-value {
    color: #f0fbff;
    text-shadow: 0 0 12px rgba(34, 211, 238, 0.25);
}

/* 手機與窄平板：航空貢獻卡改為上下排列，避免資訊擠壓 */
@media (max-width: 1024px) {
    .dashboard-panels-row {
        grid-template-columns: 1fr;
    }

    .dashboard-panels-row .airline-mission-grid,
    .airline-mission-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .dashboard-panels-row .airline-mission-card,
    .airline-mission-card {
        min-height: 0;
    }
}

/* 用戶管理：操作按鈕間距優化 */
.users-actions-cell {
    white-space: nowrap;
}

.users-actions-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.users-email-cell .users-email-text {
    display: inline-block;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    vertical-align: middle;
}

@media (max-width: 768px) {
    .users-email-cell {
        display: block !important;
        text-align: left !important;
        padding-top: 8px !important;
        padding-bottom: 8px !important;
    }

    .users-email-cell .users-email-text {
        display: block;
        max-width: 100%;
        text-align: left;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
        font-size: 0.98rem;
        margin-top: 4px;
    }

    .users-actions-cell {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 6px !important;
        white-space: nowrap !important;
    }

    .users-actions-inline {
        display: inline-flex !important;
        flex-wrap: nowrap !important;
        justify-content: flex-end !important;
        gap: 4px !important;
        margin-left: auto !important;
        width: auto !important;
    }

    .users-actions-inline .btn.btn-sm {
        padding: 6px 10px;
        min-height: 32px;
    }
}

/* Statement template modal: keep real table layout on mobile (no card split) */
@media (max-width: 768px) {
    #statementTemplateModal .statement-summary-card {
        margin: 0 !important;
        width: 100% !important;
        border: 1px solid var(--border) !important;
        border-radius: 10px !important;
        box-shadow: none !important;
        overflow: hidden !important;
    }

    #statementTemplateModal .statement-summary-card .statement-summary-table {
        display: table !important;
        width: 100% !important;
        min-width: 0 !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
    }

    #statementTemplateModal .statement-summary-card .statement-summary-table thead {
        display: table-header-group !important;
    }

    #statementTemplateModal .statement-summary-card .statement-summary-table tbody {
        display: table-row-group !important;
    }

    #statementTemplateModal .statement-summary-card .statement-summary-table tr {
        display: table-row !important;
        border: none !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
    }

    #statementTemplateModal .statement-summary-card .statement-summary-table th,
    #statementTemplateModal .statement-summary-card .statement-summary-table td {
        display: table-cell !important;
        width: auto !important;
        padding: 10px 8px !important;
        text-align: center !important;
        vertical-align: middle !important;
        border-bottom: 1px solid var(--border) !important;
        white-space: normal !important;
    }

    #statementTemplateModal .statement-summary-card .statement-summary-table tr:last-child td {
        border-bottom: none !important;
    }

    #statementTemplateModal .statement-summary-card .statement-summary-table td::before,
    #statementTemplateModal .statement-summary-card .statement-summary-table th::before {
        display: none !important;
        content: none !important;
    }
}

/* Statement template modal: mobile/tablet must show full table content */
@media (max-width: 1024px) {
    #statementTemplateModal .modal-content {
        width: min(96vw, 900px) !important;
        max-width: 96vw !important;
        margin: 4vh auto !important;
        padding: 16px !important;
    }

    #statementTemplateModal #statementTemplateTableWrap {
        overflow: auto !important;
        max-height: min(62vh, 520px) !important;
        padding-bottom: 4px !important;
    }

    #statementTemplateModal .statement-summary-card {
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    #statementTemplateModal .statement-summary-card .statement-summary-table {
        table-layout: auto !important;
        min-width: 100% !important;
    }
}

/* Orders actions: force compact single-row icons on mobile */
@media (max-width: 768px) {
    #ordersTableBody td.orders-actions-cell {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        flex-wrap: nowrap !important;
        gap: 2px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
    }

    #ordersTableBody td.orders-actions-cell::before {
        display: none !important;
        content: none !important;
    }

    #ordersTableBody .orders-actions-inline {
        display: inline-flex !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        gap: 2px !important;
        margin-left: auto !important;
    }

    #ordersTableBody .orders-actions-inline .icon-only-btn {
        width: 22px !important;
        height: 22px !important;
        min-width: 22px !important;
        padding: 1px !important;
        border-radius: 6px !important;
    }

    #ordersTableBody .orders-actions-inline .icon-only-btn svg {
        width: 11px !important;
        height: 11px !important;
    }
}

/* Final mobile header override: ensure full TRIP POINT text */
@media (max-width: 768px) {
    .header .header-left {
        max-width: calc(100% - 175px) !important;
        min-width: 0 !important;
    }

    .header .logo-container {
        min-width: 0 !important;
    }

    .header .logo-title,
    .header .logo-title.typewriter-text {
        width: auto !important;
        max-width: none !important;
        white-space: nowrap !important;
        overflow: visible !important;
        text-overflow: clip !important;
        font-size: 12px !important;
        line-height: 1.05 !important;
        border-right: none !important;
        animation: none !important;
        letter-spacing: 0 !important;
    }

    .header .logo-title.typewriter-text::after {
        display: none !important;
        content: none !important;
    }
}

/* Final mobile override: keep TRIP POINT text complete */
@media (max-width: 768px) {
    .logo-title,
    .logo-title.typewriter-text {
        width: auto !important;
        max-width: none !important;
        white-space: nowrap !important;
        overflow: visible !important;
        text-overflow: clip !important;
        border-right: none !important;
        animation: none !important;
        font-size: 13px !important;
        line-height: 1.1 !important;
        letter-spacing: 0.01em !important;
    }
}

/* Mobile logo title: always show full text (no ellipsis/typewriter clipping) */
@media (max-width: 768px) {
    .logo-title,
    .logo-title.typewriter-text {
        width: auto !important;
        max-width: none !important;
        white-space: nowrap !important;
        overflow: visible !important;
        text-overflow: clip !important;
        border-right: none !important;
        animation: none !important;
        font-size: 13px !important;
        line-height: 1.1 !important;
        letter-spacing: 0.01em !important;
    }
}

/* ===== Header final mobile fix (keep tools on right) ===== */
@media (max-width: 768px) {
    .header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        min-height: 68px !important;
        max-height: none !important;
        padding: 8px 12px !important;
    }

    .header-left {
        width: auto !important;
        max-width: calc(100% - 170px) !important;
        gap: 8px !important;
        margin-bottom: 0 !important;
        flex: 1 1 auto !important;
    }

    .logo-container {
        margin-bottom: 0 !important;
        gap: 8px !important;
    }

    .logo-text {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        min-width: 0 !important;
    }

    .logo-icon.logo-icon-fullbleed {
        width: 40px !important;
        min-width: 40px !important;
        height: 40px !important;
        max-height: 40px !important;
        border-radius: 50% !important;
        overflow: hidden !important;
    }

    .logo-icon.logo-icon-fullbleed .main-logo {
        height: 40px !important;
        width: 40px !important;
        border-radius: 50% !important;
        object-fit: cover !important;
        object-position: center !important;
        filter: none !important;
        mix-blend-mode: normal !important;
    }

    .logo-title {
        font-size: 14px !important;
        line-height: 1.1 !important;
    }

    .logo-subtitle {
        display: none !important;
    }

    /* 手機版避免飛機動畫飛出 Logo 邊界 */
    .logo-plane {
        display: none !important;
    }

    .header-right {
        grid-column: auto !important;
        grid-row: auto !important;
        margin-left: auto !important;
        margin-right: 8px !important;
        width: auto !important;
        min-width: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        flex-wrap: nowrap !important;
        gap: 6px !important;
        overflow: visible !important;
        transform: translateX(-4px) !important;
    }

    .header-icons {
        margin-right: 0 !important;
        gap: 4px !important;
        flex-shrink: 0 !important;
    }

    .header-icons .icon-btn {
        width: 32px !important;
        height: 32px !important;
    }

    .line-status {
        padding: 4px 8px !important;
        min-width: 26px !important;
        flex-shrink: 0 !important;
    }
}

/* 平板/窄桌面：避免 Logo 副標擠壓到右側圖示 */
@media (max-width: 1200px) {
    .header {
        gap: 10px !important;
    }

    .header-left {
        min-width: 0 !important;
        max-width: calc(100% - 260px) !important;
        flex: 1 1 auto !important;
    }

    .logo-container {
        min-width: 0 !important;
    }

    .logo-text {
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .logo-title {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .logo-subtitle {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
        font-size: 12px !important;
    }

    .header-right {
        flex: 0 0 auto !important;
        margin-left: auto !important;
    }
}

/* Header alignment override: keep logo left, tools right */
.header {
    padding: 10px 24px;
    min-height: 80px;
    max-height: 80px;
    align-items: center;
}

.header-left {
    max-width: none;
    margin-bottom: 0;
}

.header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: nowrap;
}

.logo-container {
    margin-bottom: 0;
    align-items: center;
}

.logo-icon.logo-icon-fullbleed {
    height: 45px;
    max-height: 45px;
    min-width: 113px;
}

.logo-icon.logo-icon-fullbleed .main-logo {
    height: 45px;
    width: auto;
}

@media (max-width: 768px) {
    .header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;
        gap: 8px;
        min-height: 72px;
        max-height: none;
        padding: 8px 12px;
    }

    .header-left {
        width: auto;
        max-width: 56%;
        gap: 8px;
        margin-bottom: 0;
    }

    .logo-container {
        margin-bottom: 0;
        gap: 8px;
    }

    .logo-icon.logo-icon-fullbleed {
        width: auto;
        min-width: 100px;
        height: 40px;
        max-height: 40px;
    }

    .logo-icon.logo-icon-fullbleed .main-logo {
        height: 40px;
    }

    .logo-title {
        font-size: 14px;
        line-height: 1.1;
    }

    .logo-subtitle {
        display: none;
    }

    .header-right {
        grid-column: auto;
        grid-row: auto;
        margin-left: auto;
        width: auto;
        justify-content: flex-end;
        overflow: visible;
        gap: 6px;
    }
}

/* 深色主題最終覆蓋：深底一律白字（功能列 + 編輯頁/Modal） */
[data-theme="dark"] .modal-content,
[data-theme="dark"] .modal-content h1,
[data-theme="dark"] .modal-content h2,
[data-theme="dark"] .modal-content h3,
[data-theme="dark"] .modal-content p,
[data-theme="dark"] .modal-content label,
[data-theme="dark"] .modal-content span,
[data-theme="dark"] .modal-content strong,
[data-theme="dark"] .modal-content small,
[data-theme="dark"] .modal-content li,
[data-theme="dark"] .notification-modal-content,
[data-theme="dark"] .notification-item,
[data-theme="dark"] .info-tooltip-content {
    color: #ffffff !important;
}

/* 對帳單範本（你截圖區塊） */
[data-theme="dark"] #statementTemplateModal .modal-content,
[data-theme="dark"] #statementTemplateModal .statement-summary-card,
[data-theme="dark"] #statementTemplateModal #statementTemplateText {
    background: #1e2f4d !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}
[data-theme="dark"] #statementTemplateModal .statement-summary-label,
[data-theme="dark"] #statementTemplateModal .statement-summary-value,
[data-theme="dark"] #statementTemplateModal h2 {
    color: #ffffff !important;
}

/* 功能列、分頁列、篩選列統一白字 */
[data-theme="dark"] .header-rate-actions,
[data-theme="dark"] .header-rate-actions .exchange-rate-btn,
[data-theme="dark"] .header-rate-actions .exchange-rate,
[data-theme="dark"] .header-rate-actions .time,
[data-theme="dark"] .tabs-nav,
[data-theme="dark"] .page-tabs,
[data-theme="dark"] .tab-btn,
[data-theme="dark"] .page-tab-btn,
[data-theme="dark"] .ai-tab-btn,
[data-theme="dark"] .persona-tab-btn,
[data-theme="dark"] .nav-tab,
[data-theme="dark"] .filter-actions,
[data-theme="dark"] .filter-actions select,
[data-theme="dark"] .filter-actions option,
[data-theme="dark"] .month-selector input {
    color: #ffffff !important;
}

/* 深色主題輸入框/文字區與 placeholder 可讀性 */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    color: #ffffff !important;
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: rgba(255, 255, 255, 0.75) !important;
}

.batch-allocation-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.batch-allocation-item {
    display: grid;
    grid-template-columns: 1fr 140px 32px;
    gap: 8px;
    align-items: center;
}

.batch-allocation-item .batch-mileage-input {
    width: 100%;
}

.batch-allocation-item .btn-remove-batch {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.batch-allocation-item .btn-remove-batch:hover {
    background: var(--danger);
    color: #ffffff;
    border-color: var(--danger);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    color: var(--text-primary);
    font-weight: 500;
}

.user-role {
    background: var(--primary-light);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    color: var(--primary);
}

/* 側邊欄：top 對齊 header 高度 (96px)，不與 logo 重疊、不壓到儀表板選單 */
.sidebar {
    position: fixed;
    left: 0;
    top: 96px;
    width: 250px;
    height: calc(100vh - 96px);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 12px var(--shadow);
}

html:not([data-theme="dark"]) .sidebar {
    background: linear-gradient(180deg, #ffffff 0%, var(--bg-tertiary) 100%);
    border-right-color: var(--border-light);
}

[data-theme="dark"] .sidebar {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, rgba(15, 23, 42, 0.98) 100%);
    border-right-color: var(--border);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.sidebar-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

body.sidebar-open {
    overflow: hidden;
}

.sidebar-nav {
    padding: 24px 0 20px 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding: 15px 20px;
    background: var(--bg-tertiary);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar-user-avatar.bear-avatar {
    font-size: 20px;
    line-height: 1;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-role {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-logout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 14px;
}

.sidebar-logout:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    margin: 0 8px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.25s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
    box-shadow: 0 1px 3px var(--shadow);
}

html:not([data-theme="dark"]) .nav-item.active {
    border-left-color: var(--rose-gold-dark);
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.12) 0%, var(--primary-light) 100%);
}

[data-theme="dark"] .nav-item.active {
    border-left-color: var(--rose-gold);
    background: linear-gradient(90deg, rgba(232, 180, 184, 0.15) 0%, var(--primary-light) 100%);
}

.nav-icon {
    margin-right: 12px;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: color 0.25s ease, filter 0.25s ease;
}

.nav-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    transition: stroke 0.25s ease, filter 0.25s ease;
}

/* 未選中：符號略帶暖色 */
.nav-icon {
    color: var(--text-muted);
}

html:not([data-theme="dark"]) .nav-icon {
    color: #8b7355;
}

[data-theme="dark"] .nav-icon {
    color: var(--text-muted);
}

.nav-item:hover .nav-icon {
    color: var(--rose-gold-dark);
    filter: drop-shadow(0 0 1px rgba(212, 175, 55, 0.4));
}

.nav-item.active .nav-icon {
    color: var(--rose-gold-dark);
    filter: drop-shadow(0 0 1px rgba(212, 175, 55, 0.6));
}

html:not([data-theme="dark"]) .nav-item.active .nav-icon {
    color: var(--rose-gold-dark);
    filter: drop-shadow(0 0 1px rgba(212, 175, 55, 0.5));
}

[data-theme="dark"] .nav-item.active .nav-icon {
    color: var(--rose-gold);
    filter: drop-shadow(0 0 1px rgba(232, 180, 184, 0.5));
}

.nav-item:hover .nav-label,
.nav-item.active .nav-label {
    color: inherit;
}

/* 主要內容區 */
.main-content {
    margin-left: 250px;
    padding: 30px;
    min-height: calc(100vh - 96px);
    background: var(--bg-primary);
}

.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 32px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.page-header p {
    color: var(--text-secondary);
}

/* 統計卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #2C3E50;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow:
        0 10px 22px rgba(15, 23, 42, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    overflow: hidden;
    color: #ffffff;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(238, 222, 180, 0.85), rgba(255, 255, 255, 0.15));
    opacity: 1;
    transform: scaleX(1);
    transition: all 0.3s ease;
}

.stat-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(140px 90px at 20% 15%, rgba(255, 255, 255, 0.18), transparent 60%);
    opacity: 0.6;
    pointer-events: none;
}

.stat-card:hover {
    box-shadow: 
        0 14px 32px rgba(15, 23, 42, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateY(-3px);
}

.stat-card:hover::before {
    opacity: 1;
}

[data-theme="dark"] .stat-card {
    background: #2C3E50;
    border-color: rgba(255, 255, 255, 0.08);
}

.stat-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon {
    width: 28px;
    height: 28px;
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 1px 1px rgba(15, 23, 42, 0.2));
}

.stat-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.stats-grid .stat-card:nth-child(1) .stat-icon {
    color: #2563eb;
}

.stats-grid .stat-card:nth-child(1) .stat-icon svg rect {
    fill: currentColor;
    stroke: none;
}

.stats-grid .stat-card:nth-child(2) .stat-icon {
    color: #d97706;
}

.stats-grid .stat-card:nth-child(2) .stat-icon svg path:first-child {
    fill: rgba(217, 119, 6, 0.14);
}

.stats-grid .stat-card:nth-child(2) .stat-icon svg circle {
    fill: currentColor;
    stroke: none;
}

.stats-grid .stat-card:nth-child(3) .stat-icon {
    color: #7c3aed;
}

.stats-grid .stat-card:nth-child(4) .stat-icon {
    color: #4f46e5;
}

html:not([data-theme="dark"]) .dashboard-page .stats-grid .stat-card .stat-icon {
    filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.2));
}

[data-theme="dark"] .stats-grid .stat-card .stat-icon {
    color: #e2e8f0;
    filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.35));
}

.stat-content {
    flex: 1;
}

.stat-card .stat-content h3 {
    color: #f0e0b8;
}

.stat-card .stat-value {
    color: #ffffff;
}

.dashboard-header p {
    color: #f5e6c6;
}

.stat-content h3 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.2;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
}

.stat-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.stat-trend {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.trend-up-indicator {
    background: linear-gradient(135deg, #d1fae5 0%, var(--rose-gold-light) 100%);
    color: #059669;
    border: 1px solid var(--rose-gold-light);
}

.trend-down-indicator {
    background: #fee2e2;
    color: #dc2626;
}

.trend-up {
    color: #059669;
    font-weight: 600;
}

.trend-down {
    color: #dc2626;
    font-weight: 600;
}

/* 航空公司統計卡片 */
.airline-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}

.airline-stat-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s;
}

.airline-stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-lg);
}

.airline-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.airline-stat-icon.cathay {
    background: linear-gradient(135deg, #2f4a6b 0%, #243b56 100%);
    color: white;
}

.airline-stat-icon.china-airlines {
    background: linear-gradient(135deg, #7a1e2b 0%, #611823 100%);
    color: white;
}

.airline-stat-icon.eva-air {
    background: linear-gradient(135deg, #1f5a4a 0%, #184739 100%);
    color: white;
}

.airline-stat-content {
    flex: 1;
}

.airline-stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
}

.airline-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.airline-stat-unit {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.airline-stat-card {
    padding: 30px;
    border-radius: 16px;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(232, 180, 184, 0.3);
    transition: all 0.3s;
}

.airline-stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--rose-gold-gradient);
    opacity: 0.8;
}

.airline-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* 國泰亞萬 - 莫蘭迪藍 */
.cathay-card {
    background: linear-gradient(135deg, #2f4a6b 0%, #243b56 100%);
    position: relative;
    overflow: hidden;
}

.cathay-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

/* 華航 - 莫蘭迪紅 */
.china-card {
    background: linear-gradient(135deg, #7a1e2b 0%, #611823 100%);
    position: relative;
    overflow: hidden;
}

.china-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

/* 長榮 - 莫蘭迪綠 */
.eva-card {
    background: linear-gradient(135deg, #1f5a4a 0%, #184739 100%);
    position: relative;
    overflow: hidden;
}

.eva-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(30%, 30%) rotate(180deg); }
}

/* 深色主題下也使用莫蘭迪色 */
[data-theme="dark"] .cathay-card {
    background: linear-gradient(135deg, #2f4a6b 0%, #243b56 100%);
}

[data-theme="dark"] .china-card {
    background: linear-gradient(135deg, #7a1e2b 0%, #611823 100%);
}

[data-theme="dark"] .eva-card {
    background: linear-gradient(135deg, #1f5a4a 0%, #184739 100%);
}

.airline-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.airline-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    backdrop-filter: blur(10px);
}

.airline-name {
    font-size: 18px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
}

.airline-mileage {
    font-size: 24px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

/* 航空公司LOGO樣式 */
.airline-logo {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    position: relative;
    overflow: hidden;
}

.airline-logo::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: logoShine 3s infinite;
}

@keyframes logoShine {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.airline-logo svg {
    width: 36px;
    height: 36px;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.airline-info h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    color: white;
}

.airline-info p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
}

.airline-value {
    font-size: 36px;
    font-weight: 800;
    color: white;
    letter-spacing: -1px;
}

/* 卡片樣式 */
.dashboard-card,
.card {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
    box-shadow: 
        0 2px 8px var(--shadow),
        0 0 0 1px rgba(232, 180, 184, 0.08);
    position: relative;
    overflow: hidden;
}

.dashboard-card::before,
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--rose-gold-gradient);
    opacity: 0;
    transform: scaleX(0);
    transition: all 0.3s ease;
}

.dashboard-card:hover::before,
.card:hover::before {
    opacity: 0.5;
    transform: scaleX(1);
}

.dashboard-card h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--text-primary);
    font-weight: 600;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.sales-report-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sales-report-actions select,
.sales-report-actions input[type="month"],
.sales-report-actions input[type="date"] {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
}

.sales-report-chart {
    min-height: 260px;
    position: relative;
    padding: 6px 6px 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: min-height 0.28s ease, padding 0.28s ease;
}

.sales-report-svg {
    width: 100%;
    height: 280px;
    display: block;
    transition: height 0.28s ease;
}

[data-theme="dark"] .sales-report-svg #salesReportLine stop {
    stop-color: #f2f4ff;
}

[data-theme="dark"] .sales-report-svg rect {
    fill: url(#salesReportLine);
    opacity: 0.9;
}

.sales-report-tooltip {
    position: absolute;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-primary);
    box-shadow: 0 6px 16px var(--shadow);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.card-header h2 {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 折疊區塊 */
.collapsible-card .collapsible-content {
    display: block;
}

.collapsible-card.collapsed .collapsible-content {
    display: none;
}

.card-icon {
    font-size: 20px;
}

.view-all-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.view-all-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.recent-orders-list {
    min-height: 200px;
}

.order-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    transition: all 0.2s;
}

.order-item:last-child {
    border-bottom: none;
}

.order-item:hover {
    background: var(--bg-hover);
    border-radius: 8px;
}

.order-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.order-airline-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

/* 國泰亞萬 - 莫蘭迪藍 */
.order-airline-icon.cathay {
    background: linear-gradient(135deg, #2f4a6b 0%, #243b56 100%);
    box-shadow: 0 2px 8px rgba(36, 59, 86, 0.25);
}

/* 華航 - 莫蘭迪紅 */
.order-airline-icon.china-airlines {
    background: linear-gradient(135deg, #7a1e2b 0%, #611823 100%);
    box-shadow: 0 2px 8px rgba(97, 24, 35, 0.25);
}

/* 長榮 - 莫蘭迪綠 */
.order-airline-icon.eva-air {
    background: linear-gradient(135deg, #1f5a4a 0%, #184739 100%);
    box-shadow: 0 2px 8px rgba(24, 71, 57, 0.25);
}

.order-info {
    flex: 1;
}

.order-customer {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.order-details {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-item-right {
    text-align: right;
}

.order-mileage {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.order-amount {
    font-size: 14px;
    color: var(--text-secondary);
}

.loading-placeholder {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.airline-distribution {
    padding: 20px 0;
}

.distribution-item {
    margin-bottom: 20px;
}

.distribution-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.distribution-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.distribution-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* 國泰亞萬 - 莫蘭迪藍 */
.distribution-dot.cathay {
    background: #2f4a6b;
    box-shadow: 0 0 0 2px rgba(47, 74, 107, 0.2), 0 0 6px rgba(47, 74, 107, 0.2);
}

/* 華航 - 莫蘭迪紅 */
.distribution-dot.china-airlines {
    background: #7a1e2b;
    box-shadow: 0 0 0 2px rgba(122, 30, 43, 0.2), 0 0 6px rgba(122, 30, 43, 0.2);
}

/* 長榮 - 莫蘭迪綠 */
.distribution-dot.eva-air {
    background: #1f5a4a;
    box-shadow: 0 0 0 2px rgba(31, 90, 74, 0.2), 0 0 6px rgba(31, 90, 74, 0.2);
}

.distribution-percentage {
    font-weight: 600;
    color: var(--text-primary);
}

.distribution-bar {
    height: 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 4px;
}

.distribution-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
}

/* 國泰亞萬 - 莫蘭迪藍 */
.distribution-bar-fill.cathay {
    background: linear-gradient(90deg, #2f4a6b 0%, #3a5a80 50%, #2f4a6b 100%);
    box-shadow: 
        0 2px 4px rgba(36, 59, 86, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    position: relative;
    overflow: hidden;
}

.distribution-bar-fill.cathay::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: barShine 2s infinite;
}

/* 華航 - 莫蘭迪紅 */
.distribution-bar-fill.china-airlines {
    background: linear-gradient(90deg, #7a1e2b 0%, #8b2636 50%, #7a1e2b 100%);
    box-shadow: 
        0 2px 4px rgba(97, 24, 35, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    position: relative;
    overflow: hidden;
}

.distribution-bar-fill.china-airlines::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: barShine 2s infinite;
}

/* 長榮 - 莫蘭迪綠 */
.distribution-bar-fill.eva-air {
    background: linear-gradient(90deg, #1f5a4a 0%, #2a6c59 50%, #1f5a4a 100%);
    box-shadow: 
        0 2px 4px rgba(24, 71, 57, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    position: relative;
    overflow: hidden;
}

.distribution-bar-fill.eva-air::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: barShine 2s infinite;
}

@keyframes barShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.distribution-value {
    font-size: 13px;
    color: var(--text-secondary);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
}

.dashboard-panels-row {
    grid-template-columns: minmax(520px, 1.35fr) minmax(0, 1.65fr);
    gap: 18px;
    align-items: start;
}

.dashboard-panels-row .airline-mission-panel {
    margin-bottom: 0;
}

.dashboard-panels-row .airline-mission-grid {
    grid-template-columns: 1fr;
    gap: 10px;
}

.dashboard-panels-row .sales-report-card {
    min-width: 0;
    align-self: start;
}

.airline-mission-panel {
    margin-bottom: 20px;
    border: 1px solid rgba(56, 189, 248, 0.28);
    background: linear-gradient(145deg, rgba(8, 47, 73, 0.22), rgba(15, 23, 42, 0.8));
}

.airline-mission-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: nowrap;
    margin-bottom: 14px;
}

.airline-mission-header > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
}

.airline-mission-header h2 {
    margin: 2px 0 4px 0;
}

.airline-mission-header p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

.airline-period-hint {
    margin-top: 8px !important;
    font-size: 12px !important;
}

.airline-filter-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    flex: 0 0 auto;
    padding: 6px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.12), rgba(30, 41, 59, 0.08));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.airline-filter-actions .airline-filter-select {
    min-width: 64px;
    height: 32px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 8px;
    padding: 0 10px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.airline-filter-actions .airline-filter-select:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.65);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

.airline-filter-actions .airline-filter-reset-btn {
    height: 32px;
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(255, 255, 255, 0.88);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.airline-filter-actions .airline-filter-reset-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(59, 130, 246, 0.55);
    color: #1d4ed8;
    background: rgba(239, 246, 255, 0.96);
}

[data-theme="dark"] .airline-filter-actions {
    border-color: rgba(51, 65, 85, 0.82);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(30, 41, 59, 0.72));
    box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.12);
}

[data-theme="dark"] .airline-filter-actions .airline-filter-select {
    border-color: rgba(71, 85, 105, 0.95);
    background: rgba(15, 23, 42, 0.9);
    color: #e2e8f0;
}

[data-theme="dark"] .airline-filter-actions .airline-filter-reset-btn {
    border-color: rgba(71, 85, 105, 0.95);
    background: rgba(15, 23, 42, 0.9);
    color: #cbd5e1;
}

[data-theme="dark"] .airline-filter-actions .airline-filter-reset-btn:hover {
    border-color: rgba(56, 189, 248, 0.65);
    color: #67e8f9;
    background: rgba(15, 23, 42, 0.98);
}

@media (max-width: 768px) {
    .airline-mission-header {
        flex-wrap: wrap;
    }

    .airline-filter-actions {
        width: 100%;
        max-width: 100%;
        padding: 4px;
        gap: 4px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
        align-items: center;
    }

    .airline-filter-actions .airline-filter-select,
    .airline-filter-actions .airline-filter-reset-btn {
        min-width: 0;
        height: 28px;
        font-size: 11px;
        border-radius: 7px;
    }

    .airline-filter-actions .airline-filter-select {
        width: 100%;
        padding: 0 8px;
    }

    .airline-filter-actions .airline-filter-reset-btn {
        width: 68px;
        padding: 0 8px;
    }
}

.airline-mission-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.airline-mission-card {
    position: relative;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 12px 26px rgba(2, 6, 23, 0.36);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.airline-mission-card:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 16px 30px rgba(2, 6, 23, 0.45);
}

.airline-mission-card.is-leading {
    border-color: rgba(250, 204, 21, 0.68);
    box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.18), 0 0 0 2px rgba(250, 204, 21, 0.22), 0 18px 36px rgba(250, 204, 21, 0.2);
}

.airline-card-meta {
    min-width: 0;
}

.airline-share {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.86);
    font-weight: 700;
}

.airline-power-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.3);
    margin-top: 10px;
    overflow: hidden;
}

.airline-power-fill {
    height: 100%;
    width: 0%;
    min-width: 2%;
    border-radius: 999px;
    transition: width 0.5s ease;
}

.airline-power-fill.cathay {
    background: linear-gradient(90deg, #1d4ed8, #38bdf8);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.45);
}

.airline-power-fill.china-airlines {
    background: linear-gradient(90deg, #991b1b, #f43f5e);
    box-shadow: 0 0 8px rgba(244, 63, 94, 0.4);
}

.airline-power-fill.eva-air {
    background: linear-gradient(90deg, #065f46, #34d399);
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.38);
}

.mission-ranking-card {
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

.mission-ranking-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border: 1px solid rgba(34, 211, 238, 0.28);
    border-radius: 14px;
}

.mission-ranking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.mission-ranking-header h2 {
    margin: 2px 0 4px 0;
}

.mission-ranking-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
}

.mission-live-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fda4af;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.mission-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #ef4444;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    animation: missionPulse 1.6s infinite;
}

@keyframes missionPulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.mission-ranking-preview {
    display: grid;
    gap: 8px;
}

.mission-preview-item {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(56, 189, 248, 0.2);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.18), 0 8px 18px rgba(14, 165, 233, 0.14);
}

.mission-preview-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 42%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    transform: skewX(-22deg);
    animation: missionPreviewSweep 3.6s linear infinite;
    pointer-events: none;
}

@keyframes missionPreviewSweep {
    0% { left: -120%; }
    100% { left: 170%; }
}

.mission-preview-rank {
    font-weight: 800;
    color: #67e8f9;
    text-shadow: 0 0 10px rgba(34, 211, 238, 0.45);
}

.mission-preview-name {
    font-weight: 700;
}

.mission-preview-mileage {
    color: #a5f3fc;
    font-family: "Consolas", "Courier New", monospace;
    text-shadow: 0 0 10px rgba(34, 211, 238, 0.38);
}

.mission-ranking-preview .mission-preview-item:first-child {
    border-color: rgba(250, 204, 21, 0.78);
    background: linear-gradient(110deg, rgba(251, 191, 36, 0.25), rgba(30, 41, 59, 0.52), rgba(251, 191, 36, 0.18));
    box-shadow:
        0 0 0 1px rgba(251, 191, 36, 0.35),
        0 0 18px rgba(251, 191, 36, 0.45),
        0 14px 26px rgba(202, 138, 4, 0.26);
}

.mission-ranking-preview .mission-preview-item:first-child::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 10px;
    border: 1px solid rgba(253, 224, 71, 0.7);
    box-shadow: inset 0 0 18px rgba(253, 224, 71, 0.24);
    pointer-events: none;
}

.mission-ranking-preview .mission-preview-item:first-child .mission-preview-rank {
    color: #facc15;
    text-shadow: 0 0 10px rgba(250, 204, 21, 0.7), 0 0 18px rgba(245, 158, 11, 0.65);
}

.mission-ranking-preview .mission-preview-item:first-child .mission-preview-mileage {
    color: #fde68a;
    text-shadow: 0 0 10px rgba(250, 204, 21, 0.65);
}

.mission-modal {
    position: fixed;
    inset: 0;
    z-index: 2200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.mission-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.78);
    backdrop-filter: blur(6px);
}

.mission-modal-dialog {
    position: relative;
    width: min(860px, 96vw);
    max-height: 88vh;
    overflow: hidden;
    border-radius: 22px;
    padding: 20px;
    border: 1px solid rgba(56, 189, 248, 0.35);
    background: linear-gradient(135deg, rgba(2, 6, 23, 0.92), rgba(15, 23, 42, 0.82));
    box-shadow: 0 24px 70px rgba(2, 132, 199, 0.22);
}

.mission-corner {
    position: absolute;
    width: 18px;
    height: 18px;
    border-color: rgba(125, 211, 252, 0.8);
    border-style: solid;
}

.mission-corner-tl { top: 8px; left: 8px; border-width: 2px 0 0 2px; }
.mission-corner-tr { top: 8px; right: 8px; border-width: 2px 2px 0 0; }
.mission-corner-bl { bottom: 8px; left: 8px; border-width: 0 0 2px 2px; }
.mission-corner-br { bottom: 8px; right: 8px; border-width: 0 2px 2px 0; }

.mission-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.mission-modal-header h3 {
    margin: 4px 0 0 0;
    font-size: 24px;
    letter-spacing: 0.03em;
    color: #e0f2fe;
}

.mission-close-btn {
    border: none;
    color: #94a3b8;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
}

.mission-close-btn:hover {
    color: #f8fafc;
}

.mission-period-tabs {
    display: flex;
    gap: 8px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(51, 65, 85, 0.9);
    border-radius: 999px;
    padding: 4px;
    width: fit-content;
    margin: 0 auto 16px;
}

.mission-period-btn {
    border: none;
    color: #94a3b8;
    background: transparent;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    cursor: pointer;
}

.mission-period-btn.is-active {
    color: #082f49;
    background: #67e8f9;
    box-shadow: 0 0 14px rgba(103, 232, 249, 0.45);
}

.mission-modal-list {
    max-height: 48vh;
    overflow-y: auto;
    padding-right: 4px;
    display: grid;
    gap: 10px;
}

.mission-row {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(51, 65, 85, 0.8);
    background: rgba(15, 23, 42, 0.62);
}

.mission-row.is-top1 {
    border-color: rgba(250, 204, 21, 0.55);
    background: linear-gradient(120deg, rgba(250, 204, 21, 0.15), rgba(15, 23, 42, 0.7), rgba(250, 204, 21, 0.1));
    background-size: 200% 100%;
    animation: missionTopShine 5s linear infinite;
}

@keyframes missionTopShine {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

.mission-rank-badge {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    font-weight: 800;
    color: #fde68a;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.55);
}

.mission-row-main {
    min-width: 0;
}

.mission-row-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    align-items: center;
}

.mission-group-name {
    color: #f8fafc;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.mission-mileage {
    color: #67e8f9;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 20px;
    font-weight: 800;
}

.mission-power-track {
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(71, 85, 105, 0.8);
    background: rgba(15, 23, 42, 0.9);
}

.mission-power-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #22d3ee);
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.45);
    transition: width 0.8s ease;
}

.mission-modal-footer {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(56, 189, 248, 0.35);
    background: rgba(15, 23, 42, 0.82);
}

.mission-status-label {
    color: #67e8f9;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.mission-status-text {
    margin-top: 4px;
    color: #f8fafc;
    font-weight: 700;
}

.mission-status-gap {
    margin-top: 4px;
    color: #facc15;
    font-size: 12px;
}

/* 儀表板（淺色主題）視覺統一：淺灰底、白卡片、Slate 字色 */
html:not([data-theme="dark"]) .dashboard-page,
html:not([data-theme="dark"]) .dashboard-page .main-content {
    background: #F8FAFC;
    color: #0F172A;
}

html:not([data-theme="dark"]) .dashboard-page .dashboard-card,
html:not([data-theme="dark"]) .dashboard-page .stat-card,
html:not([data-theme="dark"]) .dashboard-page .airline-mission-card,
html:not([data-theme="dark"]) .dashboard-page .mission-ranking-card {
    background: #FFFFFF;
    color: #0F172A;
}

html:not([data-theme="dark"]) .dashboard-page .stats-grid .stat-card {
    border: 2px solid rgba(148, 163, 184, 0.3);
    box-shadow: 0 14px 26px rgba(15, 23, 42, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

html:not([data-theme="dark"]) .dashboard-page .stats-grid .stat-card::before {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.78), rgba(34, 211, 238, 0.42));
}

html:not([data-theme="dark"]) .dashboard-page .stats-grid .stat-card::after {
    background: radial-gradient(140px 90px at 20% 15%, rgba(191, 219, 254, 0.46), transparent 60%);
    opacity: 0.85;
}

html:not([data-theme="dark"]) .dashboard-page .stats-grid .stat-card .stat-content h3 {
    color: #334155;
    font-weight: 700;
}

html:not([data-theme="dark"]) .dashboard-page .stats-grid .stat-card .stat-value {
    color: #0F172A;
}

html:not([data-theme="dark"]) .dashboard-page .stats-grid .stat-card .stat-icon-wrapper {
    border: 1px solid rgba(125, 211, 252, 0.45);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

html:not([data-theme="dark"]) .dashboard-page .stats-grid .stat-card .stat-icon {
    filter: saturate(1.3) contrast(1.05);
}

html:not([data-theme="dark"]) .dashboard-page .stats-grid .stat-card:nth-child(1) .stat-icon-wrapper {
    background: linear-gradient(135deg, rgba(219, 234, 254, 0.98), rgba(186, 230, 253, 0.95));
}

html:not([data-theme="dark"]) .dashboard-page .stats-grid .stat-card:nth-child(2) .stat-icon-wrapper {
    background: linear-gradient(135deg, rgba(254, 240, 138, 0.94), rgba(253, 186, 116, 0.92));
}

html:not([data-theme="dark"]) .dashboard-page .stats-grid .stat-card:nth-child(3) .stat-icon-wrapper {
    background: linear-gradient(135deg, rgba(221, 214, 254, 0.98), rgba(196, 181, 253, 0.94));
}

html:not([data-theme="dark"]) .dashboard-page .stats-grid .stat-card:nth-child(4) .stat-icon-wrapper {
    background: linear-gradient(135deg, rgba(191, 219, 254, 0.98), rgba(165, 180, 252, 0.94));
}

html:not([data-theme="dark"]) .dashboard-page .dashboard-card {
    border: 2px solid rgba(148, 163, 184, 0.28);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

html:not([data-theme="dark"]) .mission-ranking-card {
    background: #FFFFFF;
    border-color: rgba(59, 130, 246, 0.34);
    box-shadow: 0 16px 30px rgba(59, 130, 246, 0.14), inset 0 0 0 1px rgba(219, 234, 254, 0.95);
}

html:not([data-theme="dark"]) .mission-ranking-card::before {
    border-color: rgba(14, 165, 233, 0.5);
}

html:not([data-theme="dark"]) .mission-preview-item {
    background: #FFFFFF;
    border-color: rgba(59, 130, 246, 0.24);
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.08);
}

html:not([data-theme="dark"]) .mission-preview-item::after {
    background: linear-gradient(90deg, transparent, rgba(147, 197, 253, 0.9), transparent);
}

html:not([data-theme="dark"]) .mission-preview-rank,
html:not([data-theme="dark"]) .mission-preview-mileage {
    color: #1e40af;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.28);
}

html:not([data-theme="dark"]) .mission-ranking-preview .mission-preview-item:first-child {
    border-color: rgba(245, 158, 11, 0.78);
    background: linear-gradient(110deg, rgba(254, 240, 138, 0.75), rgba(255, 255, 255, 0.96), rgba(191, 219, 254, 0.9));
    box-shadow:
        0 0 0 1px rgba(245, 158, 11, 0.4),
        0 0 20px rgba(245, 158, 11, 0.4),
        0 12px 26px rgba(202, 138, 4, 0.22);
}

html:not([data-theme="dark"]) .mission-ranking-preview .mission-preview-item:first-child::before {
    border-color: rgba(245, 158, 11, 0.75);
    box-shadow: inset 0 0 16px rgba(245, 158, 11, 0.22);
}

html:not([data-theme="dark"]) .mission-ranking-preview .mission-preview-item:first-child .mission-preview-rank {
    color: #b45309;
    text-shadow: 0 0 8px rgba(245, 158, 11, 0.45);
}

html:not([data-theme="dark"]) .mission-ranking-preview .mission-preview-item:first-child .mission-preview-mileage {
    color: #92400e;
    text-shadow: 0 0 8px rgba(245, 158, 11, 0.38);
}

html:not([data-theme="dark"]) .airline-mission-panel {
    background: #FFFFFF;
    border-color: rgba(59, 130, 246, 0.34);
    box-shadow: 0 16px 32px rgba(59, 130, 246, 0.14), inset 0 0 0 1px rgba(219, 234, 254, 0.9);
}

html:not([data-theme="dark"]) .airline-mission-card {
    background: rgba(255, 255, 255, 0.94);
    border: 2px solid rgba(148, 163, 184, 0.34);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.95), 0 12px 24px rgba(15, 23, 42, 0.12);
}

html:not([data-theme="dark"]) .airline-mission-panel .cathay-card {
    background: linear-gradient(135deg, #60A5FA 0%, #2563EB 100%);
    border-color: rgba(30, 64, 175, 0.56);
    box-shadow: 0 12px 22px rgba(37, 99, 235, 0.34), inset 0 0 0 1px rgba(191, 219, 254, 0.4);
}

html:not([data-theme="dark"]) .airline-mission-panel .china-card {
    background: linear-gradient(135deg, #FB7185 0%, #E11D48 100%);
    border-color: rgba(159, 18, 57, 0.56);
    box-shadow: 0 12px 22px rgba(225, 29, 72, 0.3), inset 0 0 0 1px rgba(254, 205, 211, 0.4);
}

html:not([data-theme="dark"]) .airline-mission-panel .eva-card {
    background: linear-gradient(135deg, #34D399 0%, #059669 100%);
    border-color: rgba(6, 95, 70, 0.56);
    box-shadow: 0 12px 22px rgba(5, 150, 105, 0.3), inset 0 0 0 1px rgba(167, 243, 208, 0.38);
}

html:not([data-theme="dark"]) .airline-share {
    color: rgba(255, 255, 255, 0.94);
    font-weight: 800;
}

html:not([data-theme="dark"]) .airline-mission-panel .airline-name,
html:not([data-theme="dark"]) .airline-mission-panel .airline-mileage {
    color: #FFFFFF;
    text-shadow: 0 1px 2px rgba(2, 6, 23, 0.28);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

html:not([data-theme="dark"]) .airline-mission-panel .airline-card-meta {
    min-width: 0;
}

html:not([data-theme="dark"]) .airline-mission-panel .airline-card-header {
    flex-wrap: nowrap;
}

html:not([data-theme="dark"]) .airline-mission-panel .airline-share,
html:not([data-theme="dark"]) .airline-mission-panel .airline-name,
html:not([data-theme="dark"]) .airline-mission-panel .airline-mileage {
    line-height: 1.15;
}

.dashboard-panels-row .airline-mission-card {
    padding: 8px 10px 10px;
    min-height: 96px;
}

.dashboard-panels-row .airline-mission-card .airline-card-header {
    margin-bottom: 6px;
    gap: 8px;
}

.dashboard-panels-row .airline-mission-card .airline-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 16px;
}

.dashboard-panels-row .airline-mission-card .airline-name {
    font-size: 13px;
}

.dashboard-panels-row .airline-mission-card .airline-share {
    font-size: 11px;
}

.dashboard-panels-row .airline-mission-card .airline-mileage {
    font-size: 24px;
    white-space: normal;
    overflow-wrap: anywhere;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.1;
}

html:not([data-theme="dark"]) .airline-power-track {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.42);
}

html:not([data-theme="dark"]) .mission-modal-backdrop {
    background: rgba(59, 130, 246, 0.22);
}

html:not([data-theme="dark"]) .mission-modal-dialog {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.99), rgba(241, 245, 249, 0.98));
    border-color: rgba(37, 99, 235, 0.6);
    box-shadow: 0 28px 72px rgba(37, 99, 235, 0.24), inset 0 0 0 1px rgba(125, 211, 252, 0.48);
}

html:not([data-theme="dark"]) .mission-modal-header h3 {
    color: #0f172a;
}

html:not([data-theme="dark"]) .mission-close-btn {
    color: #475569;
}

html:not([data-theme="dark"]) .mission-close-btn:hover {
    color: #0f172a;
}

html:not([data-theme="dark"]) .mission-period-tabs {
    background: rgba(191, 219, 254, 0.58);
    border-color: rgba(56, 189, 248, 0.58);
}

html:not([data-theme="dark"]) .mission-period-btn {
    color: #1e3a8a;
    font-weight: 800;
}

html:not([data-theme="dark"]) .mission-period-btn.is-active {
    color: #ffffff;
    background: linear-gradient(90deg, #2563eb, #0ea5e9);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.5), 0 0 16px rgba(14, 165, 233, 0.5), 0 8px 18px rgba(37, 99, 235, 0.28);
}

html:not([data-theme="dark"]) .mission-open-btn {
    color: #ffffff !important;
    border-color: rgba(37, 99, 235, 0.65) !important;
    background: linear-gradient(90deg, #2563eb, #0284c7) !important;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.44), 0 0 18px rgba(14, 165, 233, 0.45), 0 10px 22px rgba(37, 99, 235, 0.3);
}

html:not([data-theme="dark"]) .mission-open-btn:hover {
    filter: brightness(1.06) saturate(1.08);
    transform: translateY(-1px);
}

html:not([data-theme="dark"]) .mission-row {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.99), rgba(241, 245, 249, 0.95));
    border-color: rgba(56, 189, 248, 0.52);
    box-shadow: 0 8px 18px rgba(14, 165, 233, 0.1);
}

html:not([data-theme="dark"]) .mission-row.is-top1 {
    border-color: rgba(245, 158, 11, 0.74);
    background: linear-gradient(120deg, rgba(253, 224, 71, 0.48), rgba(255, 255, 255, 0.96), rgba(191, 219, 254, 0.82));
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.4), 0 0 18px rgba(245, 158, 11, 0.42), 0 14px 28px rgba(245, 158, 11, 0.22);
}

html:not([data-theme="dark"]) .mission-rank-badge {
    color: #92400e;
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(245, 158, 11, 0.44);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.28);
}

html:not([data-theme="dark"]) .mission-group-name {
    color: #0F172A;
}

html:not([data-theme="dark"]) .mission-mileage {
    color: #1d4ed8;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.28);
}

html:not([data-theme="dark"]) .mission-power-track {
    background: rgba(219, 234, 254, 0.55);
    border-color: rgba(147, 197, 253, 0.58);
}

html:not([data-theme="dark"]) .mission-modal-footer {
    background: rgba(239, 246, 255, 0.95);
    border-color: rgba(96, 165, 250, 0.35);
}

html:not([data-theme="dark"]) .mission-status-label {
    color: #2563eb;
}

html:not([data-theme="dark"]) .mission-status-text {
    color: #0F172A;
}

html:not([data-theme="dark"]) .mission-status-gap {
    color: #b45309;
}

/* 遊戲元素：進度條流光 + 立體勳章 */
.mission-power-fill,
.airline-power-fill {
    position: relative;
    overflow: hidden;
}

.mission-power-fill::after,
.airline-power-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
    animation: hudBarShine 1.8s linear infinite;
}

@keyframes hudBarShine {
    0% { left: -120%; }
    100% { left: 160%; }
}

.mission-row:nth-child(1) .mission-rank-badge,
.mission-row:nth-child(2) .mission-rank-badge,
.mission-row:nth-child(3) .mission-rank-badge {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(15, 23, 42, 0.35);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.45),
        inset 0 -2px 0 rgba(15, 23, 42, 0.22),
        0 6px 14px rgba(15, 23, 42, 0.22);
}

.mission-row:nth-child(1) .mission-rank-badge {
    background: linear-gradient(145deg, #facc15, #f59e0b);
    border-color: rgba(217, 119, 6, 0.6);
}

.mission-row:nth-child(2) .mission-rank-badge {
    background: linear-gradient(145deg, #cbd5e1, #94a3b8);
    border-color: rgba(100, 116, 139, 0.55);
}

.mission-row:nth-child(3) .mission-rank-badge {
    background: linear-gradient(145deg, #fb923c, #f97316);
    border-color: rgba(194, 65, 12, 0.55);
}

@media (max-width: 768px) {
    .dashboard-panels-row {
        grid-template-columns: 1fr;
    }

    .airline-mission-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .airline-mission-card {
        padding: 12px;
    }

    .airline-share {
        font-size: 12px;
    }

    .mission-ranking-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .mission-open-btn {
        width: 100%;
    }

    .mission-modal {
        padding: 10px;
    }

    .mission-modal-dialog {
        width: 100%;
        max-height: 92vh;
        padding: 14px;
    }

    .mission-modal-header h3 {
        font-size: 18px;
    }

    .mission-row {
        grid-template-columns: 42px 1fr;
        padding: 10px;
    }

    .mission-rank-badge {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        font-size: 12px;
    }

    .mission-group-name {
        font-size: 14px;
    }

    .mission-mileage {
        font-size: 16px;
    }
}

/* 客戶管理：全寬版面、欄位優化、類型 Badge、圖示按鈕 */
.vendors-list-card {
    width: 100%;
    min-width: 0;
}
.vendors-list-card .vendors-list-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    width: 100%;
}
.vendors-list-card .vendors-search-input {
    flex-grow: 1;
    min-width: 180px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
}
.vendors-list-card .vendors-type-filter {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
}
.vendors-list-card .table-container {
    width: 100%;
}
.vendors-list-card .vendors-table {
    width: 100%;
    table-layout: fixed;
}
.vendors-list-card .vendors-table th,
.vendors-list-card .vendors-table td {
    padding: 10px 14px;
}
.vendors-list-card .vendors-table .col-group-name {
    width: 40%;
    text-align: left;
}
.vendors-list-card .vendors-table .col-type {
    width: 100px;
    text-align: center;
}
.vendors-list-card .vendors-table .col-contact {
    width: auto;
    text-align: left;
}
.vendors-list-card .vendors-table .col-actions {
    width: 120px;
    text-align: right;
}
.vendors-list-card .vendors-table .col-actions .btn-icon {
    margin-left: 4px;
}
/* 類型 Badge：台灣淺綠、中國淺藍 */
.vendors-list-card .badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}
.vendors-list-card .badge-taiwan {
    background: #d1fae5;
    color: #065f46;
}
.vendors-list-card .badge-china {
    background: #dbeafe;
    color: #1e40af;
}
[data-theme="dark"] .vendors-list-card .badge-taiwan {
    background: rgba(16, 185, 129, 0.25);
    color: #6ee7b7;
}
[data-theme="dark"] .vendors-list-card .badge-china {
    background: rgba(59, 130, 246, 0.25);
    color: #93c5fd;
}
/* 客戶表操作列圖示按鈕 */
.vendors-list-card .btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
}
.vendors-list-card .btn-icon:hover {
    background: var(--bg-hover);
    border-color: var(--border);
    color: var(--text-primary);
}
.vendors-list-card .btn-icon-danger:hover {
    background: var(--error);
    border-color: var(--error);
    color: white;
}

/* 表格樣式 */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

table th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
}

table td {
    color: var(--text-primary);
}

table tr:hover {
    background: var(--bg-hover);
}

/* 小樹點使用紀錄表格質感 */
.usage-table thead th {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 248, 248, 0.92));
    letter-spacing: 0.02em;
}

[data-theme="dark"] .usage-table thead th {
    background: linear-gradient(180deg, rgba(255, 240, 248, 0.95), rgba(255, 222, 238, 0.9));
    color: #3b1b2d;
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.usage-table tbody tr {
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.usage-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .usage-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.text-center {
    text-align: center;
}

/* 對帳單範本 Modal：單一卡片容器，左右各預留 5cm */
.statement-summary-card {
    margin: 0 5cm;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px var(--shadow), 0 0 0 1px rgba(232, 180, 184, 0.08);
    padding: 0;
    overflow: hidden;
}

.statement-summary-card .statement-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: fixed;
}

.statement-summary-card .statement-summary-row {
    border-bottom: 1px solid var(--border);
}

.statement-summary-card .statement-summary-row:last-child {
    border-bottom: none;
}

.statement-summary-card .statement-summary-label,
.statement-summary-card .statement-summary-value {
    padding: 10px 12px;
    border: none;
    vertical-align: middle;
    text-align: center;
}

.statement-summary-card .statement-summary-label {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
    width: 35%;
    white-space: nowrap;
}

.statement-summary-card .statement-summary-value {
    width: 65%;
    min-width: 0;
    color: var(--text-primary);
    word-break: break-word;
}

.statement-summary-card .statement-summary-value--bold {
    font-weight: 700;
}

/* 對帳單範本 Modal：淺灰背景與深色文字 */
#statementTemplateModal .modal-content {
    background-color: #F8FAFC;
    color: #333333;
}
#statementTemplateModal .statement-summary-card {
    background: #F8FAFC;
}
#statementTemplateModal .statement-summary-label,
#statementTemplateModal .statement-summary-value {
    color: #333333;
}
#statementTemplateModal .statement-summary-label {
    background: rgba(0, 0, 0, 0.04);
}
#statementTemplateModal h2,
#statementTemplateModal #statementTemplateText {
    color: #333333;
}

/* 表單頁面 */
.form-container {
    max-width: 800px;
    margin: 0 auto;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* 標籤頁樣式 */
.tabs {
    margin-bottom: 30px;
}

.tabs-nav {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
}

.orders-filter-row {
    position: relative;
    z-index: 1;
    margin-bottom: 12px;
}

.orders-table-container {
    margin-top: 6px;
}

.orders-actions-cell {
    white-space: nowrap;
}

.orders-actions-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
}

.orders-actions-inline .icon-only-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    padding: 2px 3px;
    border-radius: 8px;
}

.orders-actions-inline .icon-only-btn svg {
    width: 15px;
    height: 15px;
}

.header-rate-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.exchange-rate-btn {
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.exchange-rate-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.daily-pricing-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.daily-pricing-row {
    display: grid;
    grid-template-columns: 120px 1fr 1fr;
    gap: 12px;
    align-items: end;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-tertiary);
}

.daily-pricing-title {
    font-weight: 600;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .daily-pricing-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    font-weight: 500;
}

.tab-btn:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

[data-theme="dark"] .tab-btn {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px 8px 0 0;
}

[data-theme="dark"] .tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] .tab-btn.active {
    color: #fff;
    background: rgba(59, 130, 246, 0.25);
    border-bottom-color: transparent;
}

[data-theme="dark"] .tab-btn[data-tab="cathay"].active,
[data-theme="dark"] .tab-btn[data-tab="china-airlines"].active,
[data-theme="dark"] .tab-btn[data-tab="eva-air"].active {
    color: #fff;
    border-bottom-color: transparent;
}

/* 航空公司標籤按鈕品牌色 */
.tab-btn[data-tab="cathay"].active {
    color: white;
    background: linear-gradient(135deg, #0066CC 0%, #004499 100%);
    border-bottom-color: #0066CC;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

.tab-btn[data-tab="china-airlines"].active {
    color: white;
    background: linear-gradient(135deg, #E60012 0%, #B8000E 100%);
    border-bottom-color: #E60012;
    box-shadow: 0 2px 8px rgba(230, 0, 18, 0.3);
}

.tab-btn[data-tab="eva-air"].active {
    color: white;
    background: linear-gradient(135deg, #006847 0%, #004A33 100%);
    border-bottom-color: #006847;
    box-shadow: 0 2px 8px rgba(0, 104, 71, 0.3);
}

.tab-btn[data-tab="cathay"]:hover:not(.active) {
    color: #0066CC;
    border-bottom-color: rgba(0, 102, 204, 0.3);
}

.tab-btn[data-tab="china-airlines"]:hover:not(.active) {
    color: #E60012;
    border-bottom-color: rgba(230, 0, 18, 0.3);
}

.tab-btn[data-tab="eva-air"]:hover:not(.active) {
    color: #006847;
    border-bottom-color: rgba(0, 104, 71, 0.3);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Modal 樣式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal[style*="display: flex"],
.modal[style*="display:block"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--bg-secondary);
    margin: 5% auto;
    padding: 30px;
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px var(--shadow-lg);
    position: relative;
}

.close {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: var(--text-primary);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Badge 樣式 */
.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
    position: relative;
}

.badge::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: var(--rose-gold-gradient);
    border-radius: 12px;
    z-index: -1;
    opacity: 0.15;
    filter: blur(2px);
}

.badge-pending {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 深色主題待處理徽章 */
[data-theme="dark"] .badge-pending {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 
        0 2px 8px rgba(59, 130, 246, 0.5),
        0 0 0 1px rgba(59, 130, 246, 0.3);
}

.badge-completed {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .badge-completed {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #ffffff;
    box-shadow:
        0 2px 8px rgba(34, 197, 94, 0.5),
        0 0 0 1px rgba(34, 197, 94, 0.3);
}

/* 月結帳單狀態徽章 */
.badge-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #ffffff;
    border: 1px solid rgba(34, 197, 94, 0.6);
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.35);
}

.badge-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    border: 1px solid rgba(245, 158, 11, 0.6);
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35);
}

.statement-status-toggle {
    cursor: pointer;
    user-select: none;
}

.btn-exempt {
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1.1;
}

.statement-action {
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1.1;
}

.statement-actions-cell {
    white-space: nowrap;
    text-align: center;
}

.statement-actions-inline {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.icon-only-btn {
    padding: 4px 6px;
    min-width: auto;
    border: 1px solid rgba(17, 17, 17, 0.22) !important;
    background: rgba(255, 255, 255, 0.45) !important;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.45) !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #111111 !important;
}

.icon-only-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #111111 !important;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-only-btn:hover {
    background: transparent;
}

[data-theme="dark"] .icon-only-btn:hover {
    background: transparent;
}

[data-theme="dark"] .icon-only-btn {
    color: #f1f5f9 !important;
    border: 1px solid rgba(148, 163, 184, 0.35) !important;
    background: rgba(15, 23, 42, 0.45) !important;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
}

[data-theme="dark"] .icon-only-btn svg {
    stroke: #f1f5f9 !important;
}

[data-theme="dark"] .badge-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #ffffff;
}

[data-theme="dark"] .badge-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
}

.badge-active {
    background: #d1fae5;
    color: #059669;
}

.badge-ended {
    background: #fee2e2;
    color: #dc2626;
}

.badge-operator {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-system_admin {
    background: #fee2e2;
    color: #dc2626;
}

.badge-analyst {
    background: #e0e7ff;
    color: #6366f1;
}

.badge-billing {
    background: #f3f4f6;
    color: #4b5563;
}

/* Alert 樣式 */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid;
}

.alert-info {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e40af;
}

/* 緊湊型提示框 */
.alert-compact {
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 16px;
    border: 1px solid;
    font-size: 13px;
    line-height: 1.5;
}

.alert-info-compact {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e40af;
}

[data-theme="dark"] .alert-info-compact {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

.alert-compact strong {
    font-weight: 600;
    margin-right: 4px;
}

.alert-warning {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
}

.alert-success {
    background: #d1fae5;
    border-color: #6ee7b7;
    color: #065f46;
}

.alert-danger {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

/* 額外的淺色系樣式增強 */
.page-header h1 {
    font-weight: 700;
}

.page-header p {
    color: var(--text-muted);
}

/* 輸入框在淺色主題下的樣式 */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-family: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 500;
    letter-spacing: -0.01em;
}

/* 深色主題輸入框和下拉選單文字顏色 */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    color: white;
    background: var(--bg-secondary);
}

[data-theme="dark"] select option {
    background: var(--bg-secondary);
    color: white;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    outline: none;
}

/* 表格在淺色主題下的樣式 */
table {
    background: var(--bg-secondary);
}

table th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

table th[style*="cursor: pointer"] {
    transition: background-color 0.2s;
}

table th[style*="cursor: pointer"]:hover {
    background: var(--bg-hover);
}

table td {
    background: var(--bg-secondary);
}

/* 卡片陰影增強 */
.card,
.dashboard-card {
    box-shadow: 
        0 1px 3px var(--shadow), 
        0 1px 2px rgba(0, 0, 0, 0.06),
        0 0 0 1px rgba(232, 180, 184, 0.08);
    position: relative;
}

.card::after,
.dashboard-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--rose-gold-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover::after,
.dashboard-card:hover::after {
    opacity: 0.4;
}

/* 按鈕樣式增強 */
.btn {
    box-shadow: 0 1px 2px var(--shadow);
    transition: all 0.2s;
}

.btn-primary {
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

/* AI 獲客頁面樣式 */
.ai-header {
    margin-bottom: 30px;
}

.ai-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.ai-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* AI 標籤頁 */
.ai-tabs {
    width: 100%;
}

.ai-tabs-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.ai-tab-btn {
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: -2px;
}

.ai-tab-btn:hover {
    color: var(--primary);
    background: var(--bg-hover);
}

.ai-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--bg-hover);
}

[data-theme="dark"] .ai-tab-btn {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

[data-theme="dark"] .ai-tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] .ai-tab-btn.active {
    color: #fff;
    background: rgba(59, 130, 246, 0.25);
    border-bottom-color: transparent;
}

.tab-icon {
    font-size: 16px;
}

.ai-tab-content {
    display: none;
}

.ai-tab-content.active {
    display: block;
}

/* AI 內容區域 */
.ai-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ai-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px var(--shadow);
}

.ai-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.ai-section-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* 目標客群網格 */
.target-audience-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.audience-card {
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.audience-card:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.audience-card.selected {
    background: var(--primary-light);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.audience-icon {
    font-size: 32px;
    line-height: 1;
}

.audience-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* 生成區域 */
.ai-generation-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.ai-generation-options,
.ai-generation-result {
    min-height: 500px;
}

/* 內容類型網格 */
.content-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.content-type-card {
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.content-type-card:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.content-type-card.selected {
    background: var(--primary-light);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.content-type-icon {
    font-size: 28px;
    line-height: 1;
}

.content-type-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.content-type-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 生成按鈕 */
.btn-generate {
    width: 100%;
    margin-top: 20px;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-icon {
    font-size: 18px;
}

/* 生成結果 */
.generation-result-content {
    min-height: 400px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin-top: 16px;
}

.result-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
}

.result-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: var(--primary);
    font-size: 16px;
}

.result-error {
    padding: 20px;
    background: var(--danger);
    color: white;
    border-radius: 8px;
    text-align: center;
}

.result-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.result-header h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.result-category,
.result-type {
    padding: 4px 12px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.result-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.keyword-tag {
    padding: 4px 10px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 4px;
    font-size: 11px;
}

.result-body {
    margin-bottom: 20px;
}

.result-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft JhengHei', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    max-height: 500px;
    overflow-y: auto;
}

.result-actions {
    display: flex;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* 深色主題下的 AI 獲客頁面 */
[data-theme="dark"] .audience-card.selected,
[data-theme="dark"] .content-type-card.selected {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--primary);
}

[data-theme="dark"] .result-content {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* WordPress Modal 樣式 */
.wordpress-modal {
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.preparation-section {
    background: var(--primary-light);
    border: 1px solid var(--primary);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.preparation-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
}

.preparation-steps {
    margin: 0;
    padding-left: 20px;
    color: var(--text-primary);
}

.preparation-steps li {
    margin-bottom: 8px;
    line-height: 1.6;
    font-size: 14px;
}

.preparation-steps li:last-child {
    margin-bottom: 0;
}

.form-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.form-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
    margin-bottom: 0;
}

.required {
    color: var(--danger);
}

/* WordPress 網站列表 */
.wordpress-sites-list {
    min-height: 200px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 16px;
}

.error-message {
    padding: 20px;
    background: var(--danger);
    color: white;
    border-radius: 8px;
    text-align: center;
}

/* 人設 Modal 樣式 */
.persona-modal {
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}

.persona-tabs-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.persona-tab-btn {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: -2px;
}

.persona-tab-btn:hover {
    color: var(--primary);
    background: var(--bg-hover);
}

.persona-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--bg-hover);
}

.persona-tab-content {
    display: none;
    min-height: 300px;
}

.persona-tab-content.active {
    display: block;
}

.persona-tab-content .form-group {
    margin-bottom: 20px;
}

.persona-tab-content textarea {
    resize: vertical;
    min-height: 80px;
}

.persona-modal h2 {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

/* 表單操作按鈕樣式 */
.persona-modal .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.persona-modal .form-actions .btn {
    min-width: 100px;
    padding: 10px 20px;
}

.persona-modal .form-actions .btn-primary {
    background: var(--primary);
    color: white;
    border: none;
}

.persona-modal .form-actions .btn-primary:hover {
    background: var(--primary-dark);
}

/* 動態學習標籤頁樣式優化 */
#learning-tab .form-group {
    margin-bottom: 24px;
}

#learning-tab textarea {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft JhengHei', sans-serif;
    line-height: 1.6;
}

#learning-tab .form-hint {
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

/* LinkedIn 搜尋頁面樣式 */
.linkedin-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.linkedin-search-panel,
.linkedin-results-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px var(--shadow);
}

.panel-header {
    margin-bottom: 20px;
}

.panel-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.panel-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.panel-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.linkedin-search-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.btn-search {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 8px;
}

.linkedin-results-container {
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
}

.linkedin-results-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.linkedin-result-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s;
}

.linkedin-result-item:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.linkedin-result-item h4 {
    color: var(--text-primary);
}

.linkedin-result-checkbox {
    margin-top: 4px;
    cursor: pointer;
}

.btn-icon {
    padding: 6px 10px;
    min-width: auto;
    font-size: 16px;
    line-height: 1;
}

.btn-icon:hover {
    background: var(--bg-hover);
}

#addToLeadsBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 響應式設計 */
@media (max-width: 1024px) {
    .linkedin-wrapper {
        grid-template-columns: 1fr;
    }
    
    .form-row-2 {
        grid-template-columns: 1fr;
    }
}

/* 頁面標籤切換 */
.page-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.page-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    top: 2px;
}

.page-tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.page-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-icon {
    font-size: 16px;
}

.tab-content {
    display: block;
}

/* 角色選擇器 */
.role-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.role-btn {
    padding: 10px 20px;
    border: 2px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.role-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.role-btn.active {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.role-btn[data-role="operator"]:not(.active) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.role-btn[data-role="analyst"]:not(.active) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.role-btn[data-role="billing"]:not(.active) {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}

/* 權限表格 */
.permissions-table-container {
    overflow-x: auto;
}

.permissions-table {
    width: 100%;
    border-collapse: collapse;
}

.permissions-table thead {
    background: var(--bg-tertiary);
}

.permissions-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border);
}

.permissions-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.permissions-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.function-column {
    width: 200px;
    font-weight: 500;
}

.permission-column {
    width: 150px;
    text-align: center;
}

.permission-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.select-all-btn {
    padding: 4px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.select-all-btn:hover {
    background: var(--primary-dark);
}

.permission-checkbox {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: var(--primary);
}

.permission-checkbox:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.header-icon {
    margin-right: 8px;
}

/* 權限說明 */
.permission-description {
    margin-top: 32px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.permission-description h3 {
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 16px;
}

.permission-description ul {
    list-style: none;
    padding: 0;
}

.permission-description li {
    padding: 8px 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.permission-description li strong {
    color: var(--text-primary);
}

/* 權限操作按鈕 */
.permission-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
}

/* 深色主題適配 */
[data-theme="dark"] .role-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] .role-btn.active {
    background: var(--danger);
    color: white;
}

[data-theme="dark"] .permission-description {
    background: var(--bg-tertiary);
    border-left-color: var(--primary);
}

/* 人設特質頁面布局 */
.persona-traits-wrapper {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: start;
}

.persona-traits-left {
    flex: 1;
}

.persona-traits-right {
    position: sticky;
    top: 20px;
}

.btn-ai-generate {
    white-space: nowrap;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
}

/* 個性特質標籤 */
.personality-traits-tags {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-top: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.trait-tag {
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* 金屬邊線和立體感 */
.trait-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.3) 0%, 
        rgba(200, 200, 200, 0.2) 50%, 
        rgba(100, 100, 100, 0.1) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.trait-tag:hover::before {
    opacity: 1;
}

.trait-tag:hover {
    background: linear-gradient(145deg, 
        var(--bg-hover) 0%, 
        var(--bg-tertiary) 100%);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

.trait-tag.selected {
    background: linear-gradient(145deg, 
        var(--primary-light) 0%, 
        var(--primary) 100%);
    border-color: var(--primary);
    color: white;
    font-weight: 600;
    box-shadow: 
        0 4px 12px rgba(74, 144, 226, 0.3),
        0 2px 6px rgba(74, 144, 226, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.trait-tag.selected::before {
    opacity: 1;
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.4) 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.1) 100%);
}

.trait-tag:active {
    transform: translateY(0);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.2),
        inset 0 1px 2px rgba(0, 0, 0, 0.15),
        0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 深色主題下的個性特質標籤 */
[data-theme="dark"] .trait-tag {
    background: linear-gradient(145deg, 
        #3a3a3a 0%, 
        #2a2a2a 50%, 
        #1a1a1a 100%);
    color: white;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .trait-tag::before {
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.2) 0%, 
        rgba(200, 200, 200, 0.1) 50%, 
        rgba(100, 100, 100, 0.05) 100%);
}

[data-theme="dark"] .trait-tag:hover {
    background: linear-gradient(145deg, 
        #4a4a4a 0%, 
        #3a3a3a 50%, 
        #2a2a2a 100%);
    border-color: var(--primary);
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .trait-tag.selected {
    background: linear-gradient(145deg, 
        #5ba0f2 0%, 
        #4a90e2 50%, 
        #357abd 100%);
    color: white;
    box-shadow: 
        0 4px 12px rgba(74, 144, 226, 0.5),
        0 2px 6px rgba(74, 144, 226, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .trait-tag.selected::before {
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.3) 0%, 
        rgba(255, 255, 255, 0.15) 50%, 
        rgba(255, 255, 255, 0.05) 100%);
}

/* 響應式設計 */
@media (max-width: 1200px) {
    .personality-traits-tags {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 頁面標籤切換 */
.page-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.page-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    top: 2px;
}

.page-tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.page-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-icon {
    font-size: 16px;
}

.tab-content {
    display: block;
}

/* 角色選擇器 */
.role-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.role-btn {
    padding: 10px 20px;
    border: 2px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.role-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.role-btn.active {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.role-btn[data-role="operator"]:not(.active) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.role-btn[data-role="analyst"]:not(.active) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.role-btn[data-role="billing"]:not(.active) {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}

/* 權限表格 */
.permissions-table-container {
    overflow-x: auto;
}

.permissions-table {
    width: 100%;
    border-collapse: collapse;
}

.permissions-table thead {
    background: var(--bg-tertiary);
}

.permissions-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border);
}

.permissions-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.permissions-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.function-column {
    width: 200px;
    font-weight: 500;
}

.permission-column {
    width: 150px;
    text-align: center;
}

.permission-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.select-all-btn {
    padding: 4px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.select-all-btn:hover {
    background: var(--primary-dark);
}

.permission-checkbox {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: var(--primary);
}

.permission-checkbox:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.header-icon {
    margin-right: 8px;
}

/* 權限說明 */
.permission-description {
    margin-top: 32px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.permission-description h3 {
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 16px;
}

.permission-description ul {
    list-style: none;
    padding: 0;
}

.permission-description li {
    padding: 8px 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.permission-description li strong {
    color: var(--text-primary);
}

/* 權限操作按鈕 */
.permission-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
}

/* 深色主題適配 */
[data-theme="dark"] .role-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] .role-btn.active {
    background: var(--danger);
    color: white;
}

[data-theme="dark"] .permission-description {
    background: var(--bg-tertiary);
    border-left-color: var(--primary);
}

@media (max-width: 768px) {
    .personality-traits-tags {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 12px;
    }
    
    .trait-tag {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* 頁面標籤切換 */
.page-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.page-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    top: 2px;
}

.page-tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.page-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-icon {
    font-size: 16px;
}

.tab-content {
    display: block;
}

/* 角色選擇器 */
.role-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.role-btn {
    padding: 10px 20px;
    border: 2px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.role-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.role-btn.active {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.role-btn[data-role="operator"]:not(.active) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.role-btn[data-role="analyst"]:not(.active) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.role-btn[data-role="billing"]:not(.active) {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}

/* 權限表格 */
.permissions-table-container {
    overflow-x: auto;
}

.permissions-table {
    width: 100%;
    border-collapse: collapse;
}

.permissions-table thead {
    background: var(--bg-tertiary);
}

.permissions-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border);
}

.permissions-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.permissions-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.function-column {
    width: 200px;
    font-weight: 500;
}

.permission-column {
    width: 150px;
    text-align: center;
}

.permission-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.select-all-btn {
    padding: 4px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.select-all-btn:hover {
    background: var(--primary-dark);
}

.permission-checkbox {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: var(--primary);
}

.permission-checkbox:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.header-icon {
    margin-right: 8px;
}

/* 權限說明 */
.permission-description {
    margin-top: 32px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.permission-description h3 {
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 16px;
}

.permission-description ul {
    list-style: none;
    padding: 0;
}

.permission-description li {
    padding: 8px 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.permission-description li strong {
    color: var(--text-primary);
}

/* 權限操作按鈕 */
.permission-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
}

/* 深色主題適配 */
[data-theme="dark"] .role-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] .role-btn.active {
    background: var(--danger);
    color: white;
}

[data-theme="dark"] .permission-description {
    background: var(--bg-tertiary);
    border-left-color: var(--primary);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .persona-traits-wrapper {
        grid-template-columns: 1fr;
    }
    
    .persona-traits-right {
        position: static;
    }
    
    .btn-ai-generate {
        width: 100%;
    }
}

/* 頁面標籤切換 */
.page-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.page-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    top: 2px;
}

.page-tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.page-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-icon {
    font-size: 16px;
}

.tab-content {
    display: block;
}

/* 角色選擇器 */
.role-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.role-btn {
    padding: 10px 20px;
    border: 2px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.role-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.role-btn.active {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.role-btn[data-role="operator"]:not(.active) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.role-btn[data-role="analyst"]:not(.active) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.role-btn[data-role="billing"]:not(.active) {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}

/* 權限表格 */
.permissions-table-container {
    overflow-x: auto;
}

.permissions-table {
    width: 100%;
    border-collapse: collapse;
}

.permissions-table thead {
    background: var(--bg-tertiary);
}

.permissions-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border);
}

.permissions-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.permissions-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.function-column {
    width: 200px;
    font-weight: 500;
}

.permission-column {
    width: 150px;
    text-align: center;
}

.permission-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.select-all-btn {
    padding: 4px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.select-all-btn:hover {
    background: var(--primary-dark);
}

.permission-checkbox {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: var(--primary);
}

.permission-checkbox:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.header-icon {
    margin-right: 8px;
}

/* 權限說明 */
.permission-description {
    margin-top: 32px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.permission-description h3 {
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 16px;
}

.permission-description ul {
    list-style: none;
    padding: 0;
}

.permission-description li {
    padding: 8px 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.permission-description li strong {
    color: var(--text-primary);
}

/* 權限操作按鈕 */
.permission-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
}

/* 深色主題適配 */
[data-theme="dark"] .role-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] .role-btn.active {
    background: var(--danger);
    color: white;
}

[data-theme="dark"] .permission-description {
    background: var(--bg-tertiary);
    border-left-color: var(--primary);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
        z-index: 1001;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
    
    .header-center {
        display: none;
    }

    .header-info {
        display: none;
    }

    /* 手機版 Header：垂直排列，LOGO 在上、功能按鈕在下，高度充足不重疊 */
    .header {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        gap: 8px;
        align-items: start;
        min-height: 7rem;   /* h-28 = 112px，給 LOGO 足夠空間 */
        max-height: none;  /* 取消桌面版 96px 限制，讓兩行完整顯示 */
        padding: 12px 12px 14px;
        flex-wrap: nowrap;
    }
    .header-left {
        grid-column: 1;
        grid-row: 1;
        flex-shrink: 0;
        gap: 8px;
        margin-bottom: 0.5rem;   /* mb-2：LOGO 下方安全距離，不壓到按鈕 */
        width: 100%;
    }
    .logo-container {
        margin-bottom: 0.5rem;   /* LOGO 圖片下方留白 */
    }
    .logo-icon.logo-icon-fullbleed {
        width: 160px;
        min-width: 160px;
        height: 64px;
    }
    .logo-icon.logo-icon-fullbleed .main-logo {
        mix-blend-mode: screen;   /* 維持質感：融合效果不變 */
    }
    .logo-plane {
        --orbit-radius: 34px;
        width: 20px;
        height: 20px;
        margin: -10px 0 0 -10px;
    }
    .header-right {
        grid-column: 1;
        grid-row: 2;
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-start;
        gap: 6px;
        margin-left: 0;
        flex-shrink: 0;
        width: 100%;
        min-width: 0;
        overflow: hidden;
    }
    .header-icons {
        gap: 4px;
        margin-right: 0;
        flex-shrink: 0;
    }
    .header-icons .icon-btn {
        width: 32px;
        height: 32px;
        font-size: 15px;
    }
    .header-icons .icon-btn svg {
        width: 18px;
        height: 18px;
    }
    .header-icons .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
    .header-user-profile {
        gap: 4px;
        max-width: 32px;
    }
    .header-user-name {
        display: none;
    }
    /* LINE@ 狀態：手機版僅顯示圖示，隱藏文字避免爆版 */
    .line-status {
        flex-shrink: 0;
        padding: 5px 8px;
        font-size: 10px;
        font-weight: 500;
        border-radius: 14px;
        white-space: nowrap;
        min-width: 26px;
        justify-content: center;
        gap: 0;
    }
    .line-status .status-dot {
        width: 6px;
        height: 6px;
    }
    .line-status .line-status-text {
        display: none;
    }

    .mobile-menu-btn {
        display: inline-flex;
    }

    .floating-menu-btn {
        display: inline-flex;
    }

    /* 手機版：側邊欄列表更寬鬆 */
    .sidebar-nav {
        padding: 14px 8px;
    }

    .sidebar .nav-item {
        padding: 12px 14px;
        margin: 6px 6px;
        border-radius: 12px;
        gap: 12px;
    }

    .sidebar .nav-icon {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }

    .sidebar .nav-label {
        font-size: 15px;
        line-height: 1.3;
        letter-spacing: 0.2px;
    }
    
    .ai-generation-area {
        grid-template-columns: 1fr;
    }
    
    .target-audience-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .content-type-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .ai-tabs-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    
    .ai-tab-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-container table {
        min-width: 720px;
    }

    #groupListSection .table-container table {
        min-width: 0;
        width: 100%;
    }

    /* 全域表格 Card View（手機版） */
    .table-container table,
    table {
        min-width: 0;
        width: 100%;
        display: block;
    }
    .table-container table thead,
    table thead {
        display: none;
    }
    .table-container table tbody,
    table tbody {
        display: block;
    }
    .table-container table tr,
    table tr {
        display: block;
        border: 1px solid var(--border);
        border-radius: 8px;
        box-shadow: 0 2px 8px var(--shadow);
        margin-bottom: 12px;
        padding: 12px;
        background: var(--bg-secondary);
    }
    .table-container table tbody tr:first-child td:only-child,
    table tbody tr:first-child td:only-child {
        text-align: center;
    }
    .table-container table th,
    table th {
        display: block;
    }
    .table-container table td,
    table td {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        border-bottom: 1px solid var(--border);
        text-align: right;
    }
    .table-container table td:last-child,
    table td:last-child {
        border-bottom: none;
    }
    .table-container table td[data-label]::before,
    table td[data-label]::before {
        content: attr(data-label);
        font-weight: bold;
        text-align: left;
        margin-right: 8px;
        flex-shrink: 0;
    }

    /* 客戶管理：手機卡片視圖「操作」列單行、按鈕橫向排列 */
    .vendors-list-card .vendors-table .col-type,
    .vendors-list-card .vendors-table .col-group-name,
    .vendors-list-card .vendors-table .col-contact,
    .vendors-list-card .vendors-table .col-actions {
        width: auto !important;
    }

    .vendors-list-card .table-container table td.col-type,
    .vendors-list-card table td.col-type {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 8px !important;
        text-align: left !important;
    }

    .vendors-list-card .table-container table td.col-group-name,
    .vendors-list-card .table-container table td.col-contact,
    .vendors-list-card table td.col-group-name,
    .vendors-list-card table td.col-contact {
        display: block !important;
        text-align: left !important;
    }

    .vendors-list-card .table-container table td.col-group-name::before,
    .vendors-list-card .table-container table td.col-contact::before,
    .vendors-list-card table td.col-group-name::before,
    .vendors-list-card table td.col-contact::before {
        display: block !important;
        margin-right: 0 !important;
        margin-bottom: 4px !important;
        font-size: 1rem !important;
        font-weight: 700 !important;
        line-height: 1.35 !important;
    }

    .vendors-list-card .table-container table td.col-group-name,
    .vendors-list-card .table-container table td.col-contact,
    .vendors-list-card table td.col-group-name,
    .vendors-list-card table td.col-contact {
        font-size: 0.92rem !important;
        line-height: 1.45 !important;
        color: var(--primary) !important;
    }

    .vendors-list-card .table-container table td.col-actions,
    .vendors-list-card table td.col-actions {
        display: flex;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
    }
    .vendors-list-card .vendor-action-buttons {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 10px;
        flex-shrink: 0;
    }

    .statement-actions-cell {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    .statement-actions-inline {
        display: inline-flex;
        flex-wrap: nowrap;
        gap: 6px;
        flex-shrink: 0;
    }

    /* 營收圖表：手機版增加內距，避免 X/Y 軸標籤被裁切 */
    .sales-report-chart {
        padding: 12px 12px 16px 12px;
        min-height: 280px;
        overflow: visible;
    }
    .sales-report-svg {
        height: 280px;
        max-width: 100%;
    }

    .form-row,
    .form-row-compact {
        grid-template-columns: 1fr;
    }

    .orders-filter-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .orders-filter-row .form-group,
    .orders-filter-row button {
        width: 100%;
    }

    .orders-actions-cell {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: nowrap !important;
        gap: 6px !important;
        white-space: nowrap !important;
    }

    .orders-actions-inline {
        display: inline-flex !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        gap: 3px !important;
        margin-left: auto !important;
        flex-shrink: 0 !important;
    }

    .orders-actions-inline .icon-only-btn {
        width: 26px !important;
        height: 26px !important;
        min-width: 26px !important;
        padding: 1px 2px !important;
        border-radius: 7px !important;
    }

    .orders-actions-inline .icon-only-btn svg {
        width: 13px !important;
        height: 13px !important;
    }

    .header-actions {
        flex-wrap: wrap;
        gap: 8px;
    }

    .header-actions > * {
        width: 100%;
    }

    /* 群組列表：手機版單欄、卡片內縱向堆疊，按鈕在底部 */
    .group-list-card,
    #groupListSection {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .group-card-grid,
    #groupsTableBody {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .group-card {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: auto !important;
        min-height: auto !important;
        writing-mode: horizontal-tb !important;
        display: flex !important;
        flex-direction: column !important;
        margin-bottom: 0 !important;
        padding: 10px !important;
        gap: 6px !important;
        text-align: left !important;
        box-sizing: border-box !important;
    }

    .group-card *,
    .group-card-header,
    .group-card-desc,
    .group-card-footer,
    .group-card-count,
    .group-card-actions {
        writing-mode: horizontal-tb !important;
    }

    .group-card-header {
        display: flex !important;
        flex-wrap: wrap !important;
        text-align: left !important;
        align-items: center !important;
    }

    .group-card-desc {
        text-align: left !important;
        flex-shrink: 0 !important;
        min-height: 0 !important;
        margin: 0 !important;
        line-height: 1.25 !important;
    }

    .group-card-footer {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        text-align: left !important;
        align-items: center !important;
        margin-top: 4px !important;
        padding-top: 6px !important;
        border-top: 1px solid var(--border) !important;
        gap: 8px !important;
    }

    /* 手機版：人數標籤改為金色膠囊、置中 */
    .group-card-count {
        width: fit-content !important;
        margin: 0 !important;
        padding: 3px 14px !important;
        font-size: 13px !important;
        color: #d4af37 !important;
        border: 1px solid #d4af37 !important;
        border-radius: 9999px !important;
        background: rgba(212, 175, 55, 0.1) !important;
        white-space: nowrap !important;
    }

    .group-card-actions {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: flex-end !important;
        gap: 6px !important;
        margin-top: 0 !important;
    }

    .group-card-actions .btn,
    .group-card-actions .icon-only-btn {
        flex-shrink: 0 !important;
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        padding: 0 !important;
    }

    .group-card > * {
        min-width: 0 !important;
    }

    /* 供應商列表標題：手機版改為上下堆疊，標題不壓成直排 */
    .suppliers-list-card .suppliers-list-header .suppliers-list-header-inner {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .suppliers-list-card .suppliers-list-title {
        width: 100% !important;
        white-space: nowrap !important;
        margin-bottom: 10px !important;
    }

    .suppliers-list-card .suppliers-list-filter {
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        flex: 1 1 100% !important;
    }

    .suppliers-list-card .suppliers-search-input,
    .suppliers-list-card .suppliers-filter-select,
    .suppliers-list-card #groupFilter {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        min-height: 44px !important;
        padding: 10px 12px !important;
    }

    /* 供應商列表卡片：狀態／操作列不重疊、標籤左內容右、底部分隔 */
    .suppliers-list-card .table-container table td.suppliers-col-status,
    .suppliers-list-card .table-container table td.suppliers-col-actions {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin-bottom: 12px;
        flex-wrap: nowrap;
    }
    .suppliers-list-card .table-container table td.suppliers-col-status .badge {
        flex-shrink: 0;
        vertical-align: middle;
    }
    .suppliers-list-card .table-container table td.suppliers-col-actions {
        margin-bottom: 0;
        padding-bottom: 10px;
    }
    .suppliers-list-card .table-container table tbody tr {
        padding-bottom: 10px;
    }
    #groupsTableBody td:last-child,
    #suppliersTableBody td:last-child {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        align-items: center;
    }

    #groupsTableBody td:last-child .btn,
    #suppliersTableBody td:last-child .btn {
        width: 100%;
        padding: 4px;
        font-size: 12px;
        min-height: 28px;
        text-align: center;
        white-space: nowrap;
    }

    /* 供應商列表：覆蓋上一條，操作列改為 flex（標籤左、按鈕右），避免與狀態列重疊 */
    .suppliers-list-card #suppliersTableBody td.suppliers-col-actions {
        grid-template-columns: unset !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
    .suppliers-list-card #suppliersTableBody td.suppliers-col-actions .btn {
        width: auto !important;
        flex-shrink: 0;
    }
}

/* 頁面標籤切換 */
.page-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.page-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    top: 2px;
}

.page-tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.page-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-icon {
    font-size: 16px;
}

.tab-content {
    display: block;
}

/* 角色選擇器 */
.role-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.role-btn {
    padding: 10px 20px;
    border: 2px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.role-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.role-btn.active {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.role-btn[data-role="operator"]:not(.active) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.role-btn[data-role="analyst"]:not(.active) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.role-btn[data-role="billing"]:not(.active) {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}

/* 權限表格 */
.permissions-table-container {
    overflow-x: auto;
}

.permissions-table {
    width: 100%;
    border-collapse: collapse;
}

.permissions-table thead {
    background: var(--bg-tertiary);
}

.permissions-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border);
}

.permissions-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.permissions-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.function-column {
    width: 200px;
    font-weight: 500;
}

.permission-column {
    width: 150px;
    text-align: center;
}

.permission-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.select-all-btn {
    padding: 4px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.select-all-btn:hover {
    background: var(--primary-dark);
}

.permission-checkbox {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: var(--primary);
}

.permission-checkbox:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.header-icon {
    margin-right: 8px;
}

/* 權限說明 */
.permission-description {
    margin-top: 32px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.permission-description h3 {
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 16px;
}

.permission-description ul {
    list-style: none;
    padding: 0;
}

.permission-description li {
    padding: 8px 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.permission-description li strong {
    color: var(--text-primary);
}

/* 權限操作按鈕 */
.permission-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
}

/* 深色主題適配 */
[data-theme="dark"] .role-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] .role-btn.active {
    background: var(--danger);
    color: white;
}

[data-theme="dark"] .permission-description {
    background: var(--bg-tertiary);
    border-left-color: var(--primary);
}

/* 客戶需求單樣式 */
.vendor-demand-container {
    padding: 20px 0;
}

.vendor-demand-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.vendor-demand-panel,
.supplier-allocation-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.panel-icon {
    font-size: 24px;
}

.panel-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.panel-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.supplier-list {
    min-height: 200px;
    margin-bottom: 16px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--text-muted);
    text-align: center;
}

.empty-icon {
    font-size: 48px;
    opacity: 0.3;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-muted);
}

.supplier-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 12px;
}

.supplier-item-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.supplier-item-actions {
    display: flex;
    align-items: flex-start;
}

.btn-remove-supplier {
    padding: 8px;
    min-width: auto;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: background 0.2s;
}

.btn-remove-supplier:hover {
    background: #dc2626;
}

.btn-add-supplier {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-add-supplier span {
    font-size: 18px;
    font-weight: bold;
}

.group-list-card {
    max-width: 100%;
}

.group-card-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

/* 群組卡片：深藍灰底 + 頂部金棕高光（與儀表板卡片同配色） */
.group-card {
    background: #4a5568;
    border: 1px solid rgba(55, 65, 81, 0.9);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.group-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    border-top: 2px solid rgba(201, 162, 39, 0.85);
    pointer-events: none;
}

.group-card.dragging {
    opacity: 0.6;
}

.group-card.drag-over {
    outline: 2px dashed rgba(201, 162, 39, 0.6);
    outline-offset: 4px;
}

.group-card.loading,
.group-card.empty,
.group-card.error {
    grid-column: 1 / -1;
}

[data-theme="dark"] .group-card.drag-over {
    outline-color: rgba(255, 220, 120, 0.6);
}

.group-card::after {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.group-card {
    position: relative;
}

[data-theme="dark"] .group-card::after {
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .group-card::before {
    border-top: 2px solid rgba(201, 162, 39, 0.7);
}

.group-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
    border-color: rgba(75, 85, 99, 1);
}

.group-card:active {
    transform: translateY(0);
}

.group-list-card {
    background: transparent;
}

[data-theme="dark"] .group-list-card {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

[data-theme="dark"] .group-card {
    background: #3d4a5c;
    border: 1px solid rgba(50, 60, 75, 0.9);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .group-card:hover {
    background: #455366;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
    border-color: rgba(65, 75, 90, 1);
}

[data-theme="dark"] .group-card-count {
    background: rgba(201, 162, 39, 0.35);
    border: 1px solid rgba(201, 162, 39, 0.5);
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .group-card-count::before {
    background: rgba(201, 162, 39, 0.5);
    border-color: rgba(201, 162, 39, 0.4);
}

[data-theme="dark"] .group-card-header {
    color: #fff;
}

[data-theme="dark"] .group-card-desc {
    color: rgba(229, 192, 123, 0.95);
}

[data-theme="dark"] .group-card-actions .btn-sm.icon-only-btn {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(201, 162, 39, 0.4);
    color: rgba(229, 192, 123, 0.95);
}

[data-theme="dark"] .group-card-actions .btn-sm.icon-only-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.group-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #fff;
}

.group-card-count {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: rgba(201, 162, 39, 0.35);
    border: 1px solid rgba(201, 162, 39, 0.5);
    border-radius: 6px 10px 10px 6px;
    padding: 2px 8px;
    min-width: 46px;
    text-align: center;
    white-space: nowrap;
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.group-card-count::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    width: 8px;
    height: 8px;
    background: rgba(201, 162, 39, 0.5);
    border: 1px solid rgba(201, 162, 39, 0.4);
    border-right: none;
    border-bottom: none;
    transform: translateY(-50%) rotate(-45deg);
    border-radius: 2px;
}

.group-card-desc {
    font-size: 12px;
    color: rgba(229, 192, 123, 0.95);
    min-height: 18px;
}

.group-card-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.group-card-actions .btn-sm.icon-only-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(201, 162, 39, 0.4);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    color: rgba(229, 192, 123, 0.95);
}

.group-card-actions .btn-sm.icon-only-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(201, 162, 39, 0.6);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    color: #fff;
}

.group-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.group-card.loading,
.group-card.empty,
.group-card.error {
    justify-content: center;
    align-items: center;
    text-align: center;
    color: rgba(229, 192, 123, 0.95);
    min-height: 120px;
}

.vendor-demand-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* 供應商管理：全寬列表、篩選列、欄位優化、操作圖示按鈕 */
.suppliers-list-card {
    width: 100%;
    max-width: 100%;
}
.suppliers-list-card .suppliers-list-header {
    margin-bottom: 16px;
}
.suppliers-list-card .suppliers-list-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
}
.suppliers-list-card .suppliers-list-title {
    font-size: 18px;
    color: var(--text-primary);
    margin: 0;
}
.suppliers-list-card .suppliers-list-filter {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 280px;
    min-width: 0;
}
.suppliers-list-card .suppliers-search-input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
}
.suppliers-list-card .suppliers-filter-label {
    color: var(--text-secondary);
    font-size: 14px;
    white-space: nowrap;
}
.suppliers-list-card .suppliers-filter-select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    min-width: 160px;
}
.suppliers-list-card .suppliers-table-wrap {
    width: 100%;
}
.suppliers-list-card .suppliers-table {
    width: 100%;
    table-layout: auto;
}
.suppliers-list-card .suppliers-table .suppliers-col-group-name {
    width: 40%;
    max-width: 40%;
}
.suppliers-list-card .suppliers-table .suppliers-col-status {
    width: 1%;
    white-space: nowrap;
    text-align: center;
}
.suppliers-list-card .suppliers-table .suppliers-col-actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}
.suppliers-list-card .suppliers-col-actions .btn {
    margin-left: 4px;
}
.suppliers-list-card .suppliers-col-actions .btn:first-child {
    margin-left: 0;
}
.suppliers-list-card .suppliers-table .badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}
.suppliers-list-card .suppliers-table .badge-success {
    background: rgba(34, 197, 94, 0.18);
    color: #16a34a;
}
[data-theme="dark"] .suppliers-list-card .suppliers-table .badge-success {
    background: rgba(34, 197, 94, 0.25);
    color: #4ade80;
}
.suppliers-list-card .suppliers-table .badge-danger {
    background: rgba(239, 68, 68, 0.18);
    color: #dc2626;
}
[data-theme="dark"] .suppliers-list-card .suppliers-table .badge-danger {
    background: rgba(239, 68, 68, 0.25);
    color: #f87171;
}
.suppliers-list-card .suppliers-table th.sortable {
    cursor: pointer;
    user-select: none;
}
.suppliers-list-card .suppliers-table th.sortable .sort-icon {
    margin-left: 6px;
    opacity: 0.6;
}
.suppliers-list-card .icon-only-btn {
    padding: 6px;
    min-width: 32px;
    min-height: 32px;
}
.suppliers-list-card .icon-only-btn svg {
    display: block;
    margin: 0 auto;
}

.summary-info {
    display: flex;
    gap: 24px;
    align-items: center;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.summary-value {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

.btn-confirm {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
}

.btn-confirm span {
    font-size: 18px;
}

.required {
    color: var(--danger);
}

@media (max-width: 1024px) {
    .vendor-demand-grid {
        grid-template-columns: 1fr;
    }
    
    .vendor-demand-footer {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .summary-info {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .btn-confirm {
        width: 100%;
        justify-content: center;
    }
}

/* 頁面標籤切換 */
.page-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.page-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    top: 2px;
}

.page-tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.page-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-icon {
    font-size: 16px;
}

.tab-content {
    display: block;
}

/* 角色選擇器 */
.role-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.role-btn {
    padding: 10px 20px;
    border: 2px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.role-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.role-btn.active {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.role-btn[data-role="operator"]:not(.active) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.role-btn[data-role="analyst"]:not(.active) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.role-btn[data-role="billing"]:not(.active) {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}

/* 權限表格 */
.permissions-table-container {
    overflow-x: auto;
}

.permissions-table {
    width: 100%;
    border-collapse: collapse;
}

.permissions-table thead {
    background: var(--bg-tertiary);
}

.permissions-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border);
}

.permissions-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.permissions-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.function-column {
    width: 200px;
    font-weight: 500;
}

.permission-column {
    width: 150px;
    text-align: center;
}

.permission-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.select-all-btn {
    padding: 4px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.select-all-btn:hover {
    background: var(--primary-dark);
}

.permission-checkbox {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: var(--primary);
}

.permission-checkbox:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.header-icon {
    margin-right: 8px;
}

/* 權限說明 */
.permission-description {
    margin-top: 32px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.permission-description h3 {
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 16px;
}

.permission-description ul {
    list-style: none;
    padding: 0;
}

.permission-description li {
    padding: 8px 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.permission-description li strong {
    color: var(--text-primary);
}

/* 權限操作按鈕 */
.permission-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
}

/* 深色主題適配 */
[data-theme="dark"] .role-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] .role-btn.active {
    background: var(--danger);
    color: white;
}

[data-theme="dark"] .permission-description {
    background: var(--bg-tertiary);
    border-left-color: var(--primary);
}

/* 小樹點使用明細和月結帳單頁面樣式 */
.btn-tree-points {
    background: linear-gradient(135deg, #28a79a 0%, #1b6f67 100%);
    color: #fff;
    border: 1px solid rgba(40, 167, 154, 0.7);
}

.btn-tree-points:hover {
    background: linear-gradient(135deg, #2fc1b1 0%, #208277 100%);
}

[data-theme="light"] .btn-tree-points {
    background: linear-gradient(135deg, #29c3b2 0%, #1f8f85 100%);
    color: #fff;
    border: 1px solid rgba(41, 195, 178, 0.7);
}

[data-theme="light"] .btn-tree-points:hover {
    background: linear-gradient(135deg, #31d4c2 0%, #23a196 100%);
}

/* 摘要卡片網格 */
.summary-cards-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    margin-bottom: 24px;
    align-items: stretch;
}

.summary-metrics-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.summary-metrics-group .summary-card {
    min-width: 0;
}

.summary-card {
    background: #2C3E50;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
    color: #ffffff;
}

.summary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(238, 222, 180, 0.85), rgba(255, 255, 255, 0.15));
}

.summary-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(140px 90px at 20% 15%, rgba(255, 255, 255, 0.18), transparent 60%);
    opacity: 0.6;
    pointer-events: none;
}

.summary-card-icon {
    font-size: 36px;
    line-height: 1;
}

.summary-card-content {
    flex: 1;
}

.summary-card-label {
    font-size: 14px;
    color: rgba(238, 222, 180, 0.85);
    margin-bottom: 8px;
}

.summary-card-value {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    line-height: 1.1;
}

.summary-ranking-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    min-height: 100%;
}

.summary-ranking-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-ranking-card .summary-card-label {
    margin-bottom: 0;
    font-weight: 800;
}

.summary-ranking-subtitle {
    font-size: 12px;
    color: rgba(238, 222, 180, 0.75);
    font-weight: 600;
}

.summary-ranking-preview {
    display: grid;
    gap: 6px;
}

.summary-ranking-preview .mission-preview-item {
    padding: 8px 10px;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    border-radius: 8px;
}

.summary-ranking-preview .mission-preview-rank {
    color: #f59e0b;
    text-shadow: 0 0 8px rgba(245, 158, 11, 0.45), 0 1px 0 rgba(255, 255, 255, 0.25);
}

.summary-ranking-preview .mission-preview-name {
    color: #0f172a;
    font-weight: 800;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
    -webkit-text-stroke: 0.2px rgba(15, 23, 42, 0.22);
}

[data-theme="dark"] .summary-ranking-preview .mission-preview-name {
    color: #f8fafc;
    text-shadow: 0 1px 1px rgba(2, 6, 23, 0.6);
    -webkit-text-stroke: 0;
}

.summary-ranking-preview .mission-preview-mileage {
    color: #fde68a;
    font-weight: 800;
    text-shadow: 0 0 8px rgba(245, 158, 11, 0.35);
}

.summary-ranking-list {
    display: grid;
    gap: 6px;
}

.summary-ranking-item {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.summary-ranking-rank {
    font-weight: 800;
    color: rgba(255, 255, 255, 0.9);
}

.summary-ranking-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: rgba(255, 255, 255, 0.92);
    font-weight: 600;
}

.summary-ranking-mileage {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 700;
}

.summary-ranking-empty {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.72);
}

@media (max-width: 1200px) {
    .summary-cards-grid {
        grid-template-columns: 1fr;
    }

    .summary-metrics-group {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .summary-metrics-group {
        grid-template-columns: 1fr;
    }
}

html:not([data-theme="dark"]) .summary-ranking-subtitle {
    color: #64748b;
}

html:not([data-theme="dark"]) .summary-ranking-preview .mission-preview-item {
    border-color: rgba(59, 130, 246, 0.22);
}

/* 營利報表：搜尋欄位高度更緊湊 */
.report-filter-row input,
.report-filter-row select {
    min-height: 36px;
    height: 36px;
    padding: 6px 10px;
}

/* 營利報表：沉穩深色系卡片 */
.report-stats .stat-card {
    background: #2C3E50;
    color: #f7f4ea;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.35);
}

.report-stats .stat-card::before {
    height: 1px;
    background: linear-gradient(90deg, rgba(238, 222, 180, 0.8), rgba(255, 255, 255, 0.2));
    opacity: 1;
    transform: scaleX(1);
}

.report-stats .stat-card::after {
    background: radial-gradient(140px 90px at 20% 15%, rgba(255, 255, 255, 0.18), transparent 60%);
    opacity: 0.6;
}

.report-stats .stat-card .stat-content h3 {
    color: rgba(238, 222, 180, 0.85);
}

.report-stats .stat-card .stat-value {
    color: #ffffff;
}

.report-stats .stat-card .stat-icon {
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.3));
}

/* 篩選區塊 */
.filter-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 24px;
    overflow: hidden;
}

.filter-header {
    padding: 16px 20px;
    background: var(--bg-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
    user-select: none;
}

.filter-toggle-icon {
    font-size: 12px;
    transition: transform 0.3s;
}

.filter-content {
    padding: 20px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.search-input-wrapper,
.date-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon,
.date-icon {
    position: absolute;
    left: 12px;
    font-size: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input-wrapper input,
.date-input-wrapper input {
    padding-left: 36px;
    width: 100%;
}

/* 快速篩選按鈕 */
.quick-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-filter-btn {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-filter-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.quick-filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 深色主題快速篩選按鈕 */
[data-theme="dark"] .quick-filter-btn {
    color: white;
    background: var(--bg-tertiary);
}

[data-theme="dark"] .quick-filter-btn:hover {
    color: white;
    background: var(--bg-hover);
}

[data-theme="dark"] .quick-filter-btn.active {
    color: white;
    background: var(--primary);
}

/* 月結帳單頁面樣式 */
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.info-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.info-tooltip-btn {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    padding: 0;
}

.info-tooltip-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
}

.info-tooltip-content {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translate(-50%, 6px);
    width: min(420px, 70vw);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 28px var(--shadow);
    padding: 12px 14px;
    color: var(--text-primary);
    font-size: 12px;
    line-height: 1.6;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 20;
}

.info-tooltip-content strong {
    display: block;
    margin-bottom: 6px;
}

.info-tooltip-content ul {
    margin: 0;
    padding-left: 18px;
    color: var(--text-secondary);
}

.info-tooltip:hover .info-tooltip-content,
.info-tooltip:focus-within .info-tooltip-content {
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
}

[data-theme="dark"] .info-tooltip-content {
    background: rgba(20, 24, 38, 0.92);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45);
}

.exchange-rate {
    display: flex;
    align-items: center;
    gap: 8px;
}

.exchange-rate label {
    font-size: 14px;
    color: var(--text-secondary);
}

.exchange-rate-value {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.icon-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    color: var(--text-primary);
}

.icon-btn:hover {
    background: var(--bg-hover);
}

/* 深色主題圖標按鈕 */
[data-theme="dark"] .icon-btn {
    color: white;
    border-color: var(--border);
}

[data-theme="dark"] .icon-btn:hover {
    color: white;
    background: var(--bg-hover);
}

.month-selector input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-secondary);
}

/* 深色主題月份選擇器 */
[data-theme="dark"] .month-selector input {
    color: white;
    background: var(--bg-secondary);
}

/* 導航標籤 */
.statement-nav-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
}

.nav-tabs {
    display: flex;
    gap: 8px;
}

.nav-tab {
    padding: 10px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 深色主題導航標籤 */
[data-theme="dark"] .nav-tab {
    color: white;
    background: var(--bg-tertiary);
}

[data-theme="dark"] .nav-tab:hover {
    color: white;
    background: var(--bg-hover);
}

[data-theme="dark"] .nav-tab.active {
    color: white;
    background: var(--primary);
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.statement-nav-section .btn {
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.statement-nav-section .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.28);
    filter: saturate(1.06);
}

.statement-nav-section .btn:active {
    transform: translateY(0);
}

#generateStatementBtn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: rgba(37, 99, 235, 0.7);
}

#openManualStatementBtn {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border-color: rgba(79, 70, 229, 0.72);
}

#exportBtn {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    border-color: rgba(2, 132, 199, 0.72);
}

#manualSupplierAccountCheckBtn {
    background: linear-gradient(135deg, #14b8a6, #0f766e);
    border-color: rgba(15, 118, 110, 0.72);
}

.statement-nav-section .btn-tree-points {
    background: linear-gradient(135deg, #22c55e, #15803d);
    border-color: rgba(21, 128, 61, 0.72);
}

.statement-right-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.statement-right-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    line-height: 1.1;
    font-size: clamp(12px, 1.15vw, 15px);
    padding: 10px 12px;
}

.statement-right-actions .btn span {
    flex-shrink: 0;
}

.statements-table th.statement-col-supplier {
    width: 220px;
    min-width: 220px;
}

.statements-table td.statement-supplier-cell {
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes statementHighlightPulse {
    0%, 100% {
        background-color: transparent;
        box-shadow: inset 0 0 0 0 rgba(255, 235, 59, 0);
    }
    35%, 75% {
        background-color: rgba(255, 235, 59, 0.28);
        box-shadow: inset 0 0 0 9999px rgba(255, 235, 59, 0.18);
    }
}

tr.statement-row-highlight td {
    animation: statementHighlightPulse 1.2s ease-in-out 3;
}

.filter-actions select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-secondary);
}

/* 深色主題篩選操作 */
[data-theme="dark"] .filter-actions select {
    color: white;
    background: var(--bg-secondary);
}

[data-theme="dark"] .filter-actions select option {
    background: var(--bg-secondary);
    color: white;
}

[data-theme="dark"] .statement-nav-section .btn {
    border-color: rgba(71, 85, 105, 0.85);
    box-shadow: 0 8px 18px rgba(2, 6, 23, 0.45), inset 0 1px 0 rgba(226, 232, 240, 0.08);
}

/* 計算公式說明 */
.formula-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin-top: 24px;
}

.formula-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.formula-icon {
    font-size: 20px;
}

.formula-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.formula-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.formula-item {
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    border: 1px solid var(--border);
}

.formula-item strong {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.formula-item p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 4px 0;
    line-height: 1.6;
}

.formula-note {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

/* 表格樣式增強 */
table .date-icon {
    margin-right: 6px;
    font-size: 14px;
}

.usage-table .date-icon {
    position: static;
    left: auto;
    display: inline-flex;
    align-items: center;
}

table .text-danger {
    color: var(--danger);
}

table .text-primary {
    color: var(--primary);
}

[data-theme="dark"] .usage-table td.text-primary {
    color: #e6f0ff;
}

.usage-table .action-buttons {
    justify-content: center;
}

.usage-action-btn {
    width: 34px;
    height: 34px;
    padding: 0;
}

.usage-action-btn svg {
    width: 18px;
    height: 18px;
}

.usage-table .action-buttons .btn {
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #1f2937;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.usage-table .action-buttons .btn:hover {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(148, 163, 184, 0.45);
}

.usage-table .action-buttons .btn svg {
    stroke: currentColor;
}

[data-theme="dark"] .usage-table .action-buttons .btn {
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #f1f5f9;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .usage-table .action-buttons .btn:hover {
    background: rgba(30, 41, 59, 0.6);
}

.badge-danger {
    background: var(--danger);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    margin-right: 0;
}

.status-icon {
    margin-right: 4px;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .summary-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-grid {
        grid-template-columns: 1fr;
    }
    
    .statement-nav-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .nav-tabs {
        width: 100%;
    }
    
    .nav-tab {
        flex: 1;
        text-align: center;
    }
    
    .filter-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .filter-actions select,
    .filter-actions button {
        width: 100%;
    }

    .statement-right-actions {
        width: 100%;
        margin-left: 0;
        gap: 8px;
    }

    .statement-right-actions .btn {
        width: 100%;
        font-size: 13px;
        padding: 10px 10px;
        white-space: nowrap;
    }
    
    .formula-content {
        grid-template-columns: 1fr;
    }
    
    .header-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
}

/* 頁面標籤切換 */
.page-tabs {
    display: flex;
    gap: 12px;
    margin: 24px 0;
    padding-bottom: 0;
    border-bottom: none;
}

.page-tab-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: #e5e7eb;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #1f2937;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-tab-btn:hover {
    background: #d1d5db;
    border-color: #9ca3af;
}

.page-tab-btn.active {
    background: #f9fafb;
    color: #111827;
    border-color: #9ca3af;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .page-tab-btn {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

[data-theme="dark"] .page-tab-btn:hover {
    background: #4b5563;
    border-color: #6b7280;
}

[data-theme="dark"] .page-tab-btn.active {
    background: #1f2937;
    color: #f9fafb;
    border-color: #6b7280;
}

.tab-icon {
    font-size: 18px;
    display: inline-block;
    line-height: 1;
}

.tab-icon.users-icon {
    color: #9333ea;
}

.tab-icon.permissions-icon {
    color: #3b82f6;
}

[data-theme="dark"] .tab-icon.users-icon {
    color: #a855f7;
}

[data-theme="dark"] .tab-icon.permissions-icon {
    color: #60a5fa;
}

.tab-icon {
    font-size: 16px;
}

.tab-content {
    display: block;
}

.section-header {
    margin-bottom: 24px;
}

/* 定價設定頁面樣式 */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 20px;
}

.pricing-card {
    padding: 20px;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.pricing-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.pricing-form-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pricing-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pricing-form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0;
}

.pricing-input {
    width: 100%;
    max-width: 280px;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.2s;
}

.pricing-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

[data-theme="dark"] .pricing-input {
    background: var(--bg-tertiary);
    color: white;
    border-color: var(--border);
}

[data-theme="dark"] .pricing-input:focus {
    border-color: var(--primary);
    background: var(--bg-secondary);
}

@media (max-width: 768px) {
    .pricing-grid {
        grid-template-columns: 1fr;
    }
    
    .pricing-form-grid {
        grid-template-columns: 1fr;
    }
    
    .pricing-input {
        max-width: 100%;
    }
}

.section-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

/* 里程規則網格布局 */
.mileage-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.mileage-settings-grid .form-group {
    margin-bottom: 0;
}

.mileage-settings-grid .form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.mileage-settings-grid .form-group input {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.2s;
}

.mileage-settings-grid .form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

[data-theme="dark"] .mileage-settings-grid .form-group input {
    background: var(--bg-tertiary);
    color: white;
    border-color: var(--border);
}

[data-theme="dark"] .mileage-settings-grid .form-group input:focus {
    border-color: var(--primary);
    background: var(--bg-secondary);
}

@media (max-width: 768px) {
    .mileage-settings-grid {
        grid-template-columns: 1fr;
    }
}

/* 轉讓規則編輯器樣式 */
.transfer-rules-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.transfer-rules-section:last-child {
    border-bottom: none;
}

.transfer-rules-section h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
    letter-spacing: 0.5px;
}

[data-theme="dark"] .transfer-rules-section h3 {
    color: #60a5fa;
    border-bottom-color: #60a5fa;
}

.rules-editor {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rule-input {
    flex: 1;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.2s;
}

.rule-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

[data-theme="dark"] .rule-input {
    background: var(--bg-tertiary);
    color: white;
    border-color: var(--border);
}

[data-theme="dark"] .rule-input:focus {
    border-color: var(--primary);
    background: var(--bg-secondary);
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--error);
    border-color: var(--error);
    color: white;
}

/* 角色選擇器 */
.role-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.role-btn {
    padding: 10px 20px;
    border: 2px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.role-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.role-btn.active {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.role-btn[data-role="operator"]:not(.active) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.role-btn[data-role="analyst"]:not(.active) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.role-btn[data-role="billing"]:not(.active) {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}

/* 權限表格 */
.permissions-table-container {
    overflow-x: auto;
}

.permissions-table {
    width: 100%;
    border-collapse: collapse;
}

.permissions-table thead {
    background: var(--bg-tertiary);
}

.permissions-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border);
}

.permissions-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.permissions-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.function-column {
    width: 200px;
    font-weight: 500;
}

.permission-column {
    width: 150px;
    text-align: center;
}

.permission-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.select-all-btn {
    padding: 4px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.select-all-btn:hover {
    background: var(--primary-dark);
}

.permission-checkbox {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: var(--primary);
}

.permission-checkbox:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.header-icon {
    margin-right: 8px;
}

/* 權限說明 */
.permission-description {
    margin-top: 32px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.permission-description h3 {
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 16px;
}

.permission-description ul {
    list-style: none;
    padding: 0;
}

.permission-description li {
    padding: 8px 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.permission-description li strong {
    color: var(--text-primary);
}

/* 權限操作按鈕 */
.permission-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
}

/* 深色主題適配 */
[data-theme="dark"] .role-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] .role-btn.active {
    background: var(--danger);
    color: white;
}

[data-theme="dark"] .permission-description {
    background: var(--bg-tertiary);
    border-left-color: var(--primary);
}
