/* 引導與推廣響應式容器 */
.guide-promo-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.guide-promo-row>div {
    flex: 1;
    min-width: 300px;
    display: flex;
}

.guide-promo-row>div>* {
    flex: 1;
}

@media (max-width: 768px) {
    .guide-promo-row {
        flex-direction: column;
    }

    .guide-promo-row>div {
        min-width: 100%;
    }
}

.card-flat {
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* 布局與對齊 Utility (與 global.css 互補) */
.flex-between-center {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-row-gap {
    display: flex;
    gap: 10px;
}

.flex-column-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.flex-shrink-0 {
    flex-shrink: 0;
}

.m-0 {
    margin: 0 !important;
}

.mb-3 {
    margin-bottom: 15px !important;
}

.mt-1 {
    margin-top: 5px !important;
}

.mt-2 {
    margin-top: 10px !important;
}

.font-bold {
    font-weight: bold;
}

.text-large {
    font-size: 1.1rem;
}

.text-caption {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 橫幅容器 (Banners) */
.banner-flex-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    /* Allow wrapping */
}

.banner-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.request-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.founder-banner {
    /* Override blue border from guide-box */
    border: 1px solid #ffe0b2;
    border-left: 5px solid var(--c-brand-orange) !important;
    background: var(--bg-status-warning);
}

/* Fix for potential ::before artifact reported by user */
.founder-banner::before,
.guide-box::before {
    content: none !important;
    display: none !important;
}

.founder-title {
    margin: 0;
    color: #E65100;
    font-size: 1.25rem;
}

/* 通知與狀態 (Notices) */
.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    border-radius: 8px;
}

.locked-msg {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-card);
    text-align: center;
    border: 1px solid var(--border-color);
}

.plan-card {
    background-color: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius-main);
    box-shadow: var(--shadow-soft);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    position: relative;
    max-width: 100%;
    text-align: center;
}

.removed-notice {
    background-color: var(--bg-status-danger);
    border: 1px solid #ffccbc;
    border-radius: var(--radius-main);
    padding: 25px;
    text-align: center;
    margin-bottom: 25px;
    color: #d32f2f;
}

.conflict-alert {
    margin: 15px 0;
    padding: 12px;
    border: 1px solid #ffebee;
    background: #fff8e1;
    border-left: 5px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    font-size: 0.95em;
}

.alert-danger-soft {
    background: #ffebee;
    border-color: #ef5350;
    color: #c62828 !important;
}

[data-theme="dark"] .conflict-alert {
    background: #3e2723;
    border-color: #5d4037;
    color: #ffccbc;
}

.empty-state {
    padding: 60px 20px;
    text-align: center;
    background: var(--bg-card);
    border-radius: var(--radius-main);
    border: 1px dashed var(--border-color);
    margin-bottom: 25px;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

/* 統一推廣中心卡片樣式 */
.promotion-center-card {
    background: linear-gradient(135deg, #f0f7ff 0%, #e3f2fd 100%);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #bbdefb;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 140px;
}

[data-theme="dark"] .promotion-center-card {
    background: linear-gradient(135deg, #1a237e 0%, #121858 100%);
    border-color: #303f9f;
}

.promotion-center-card h3 {
    margin: 0 0 10px;
    color: #0d47a1;
    font-size: 1.1rem;
}

[data-theme="dark"] .promotion-center-card h3 {
    color: #90caf9;
}

.promotion-center-card p {
    margin: 0 0 15px;
    color: #1565c0;
    font-size: 0.9rem;
    line-height: 1.5;
}

[data-theme="dark"] .promotion-center-card p {
    color: #b0bec5;
}

.promotion-center-card .bg-icon {
    position: absolute;
    right: -10px;
    bottom: -10px;
    font-size: 5rem;
    color: rgba(13, 71, 161, 0.08);
    transform: rotate(-15deg);
    pointer-events: none;
}

[data-theme="dark"] .promotion-center-card .bg-icon {
    color: rgba(144, 202, 249, 0.05);
}

.card[style*="border-left"] {
    border-left-width: 5px !important;
    border-left-style: solid !important;
}

.wish-card {
    border-left: 5px solid var(--c-brand-orange);
}

.ext-card {
    border-left: 5px solid #9C27B0;
}

/* 訂單卡片 */
.order-card {
    background: var(--bg-card);
    padding: 15px;
    border-radius: var(--radius-main);
    border: 1px solid var(--border-color);
    margin-bottom: 15px;
    box-shadow: var(--shadow-soft);
    border-left: 5px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.2s;
}

.order-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.order-card.status-Locked {
    border-left-color: var(--c-brand-blue);
}

.order-card.status-Authorized {
    border-left-color: var(--c-brand-green);
}

.order-card.status-Pending_Owner_Approval {
    border-left-color: var(--c-brand-orange);
}

.order-card.status-Payment_Pending {
    border-left-color: var(--c-brand-red);
    background-color: #FFF0F5;
    /* 特殊背景 */
}

.order-card.status-Completed {
    border-left-color: var(--text-muted);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    color: var(--text-main);
    border-bottom: 1px solid var(--bg-hover);
    padding-bottom: 8px;
}

.order-body {
    font-size: 0.95em;
    color: var(--text-secondary);
    line-height: 1.6;
}

.order-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
}

/* Badge Status Map & Special Styles */
.status-Payment_Pending {
    border-left: 5px solid #E91E63 !important;
    background-color: #FFF0F5;
}

.badge-Payment_Pending {
    background-color: #E91E63;
    color: white;
}

/* 狀態文字顏色 (用於 Detail View) */
.status-verified {
    color: var(--c-brand-green);
    font-weight: bold;
}

.status-conflict {
    color: #ab47bc;
    font-weight: bold;
}

.status-rejected {
    color: #ef5350;
    font-weight: bold;
}

.status-pending_audit {
    color: var(--c-brand-orange);
}

/* 會員與角色 Badge 擴充 */
.badge-admin {
    background: var(--c-brand-blue);
    color: white;
    border: none;
    margin-left: 4px;
}

.admin-badge-v2 {
    background: var(--c-accent);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    margin-top: 10px;
}

.item-code-display {
    font-family: monospace;
    font-weight: bold;
    color: var(--c-brand-blue);
}

.badge-orange-outline {
    background-color: rgba(255, 152, 0, 0.1);
    color: #E65100;
    border: 1px solid #ffe0b2;
}

.btn-orange-outline {
    color: #E65100;
    border: 1px solid #E65100;
    background: transparent;
}

.btn-orange-outline:hover {
    background-color: #E65100;
    color: white;
}

/* 額度條樣式 (Quota Bar) */
.quota-box {
    margin: 15px 0 20px 0;
    padding: 15px 10px;
    background: var(--bg-hover);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.quota-text {
    font-size: 1em;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.quota-track {
    background: #e0e0e0;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.quota-fill {
    height: 100%;
    background: var(--c-brand-green);
    width: 0%;
    transition: width 0.5s;
}

.quota-fill.warn {
    background: var(--c-brand-orange);
}

.quota-fill.danger {
    background: var(--c-brand-red);
}

/* SaaS Locked Input */
.saas-locked-input {
    background-color: #f0f0f0 !important;
    color: #999 !important;
    cursor: not-allowed;
    border-color: #ddd !important;
}

[data-theme="dark"] .saas-locked-input {
    background-color: #333 !important;
    color: #777 !important;
    border-color: #444 !important;
}

/* 檔案上傳疊加層 */
.file-input-overlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.slot-status-open {
    color: var(--c-brand-green);
}

.slot-status-closed {
    color: var(--text-muted);
}

.icon-2xl {
    font-size: 2rem;
}

.btn-locked {
    cursor: not-allowed;
    opacity: 0.7;
}

/* 方案卡片 (SaaS) */
.plan-card {
    border-left: 5px solid var(--c-brand-purple) !important;
    padding: 20px;
    background: var(--bg-card);
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    position: relative;
}

.plan-title {
    margin: 0;
    color: var(--c-brand-purple);
    font-size: 1.25rem;
    font-weight: bold;
}

.badge-premium {
    background: var(--c-brand-purple);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: bold;
}

/* 職位與角色標籤 */
.badge-head {
    background: var(--bg-status-warning);
    color: #E65100;
    min-width: 71px;
    border: 1px solid #ffe0b2;
}

.badge-member {
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* 自定義彈窗 (用於 Board) */
.custom-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-modal-overlay);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

.custom-modal-content {
    background-color: var(--bg-card);
    color: var(--text-main);
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-card);
    position: relative;
    border: 1px solid var(--border-color);
}

.support-footer {
    margin-top: 40px;
    padding: 30px;
    background: var(--bg-card);
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
}

/* 🚨 Hybrid Responsive Date Input (Mobile Strict MM/DD, PC Native) */
.responsive-date-group {
    position: relative;
    display: flex;
    align-items: center;
}

/* PC Default: Native Input Visible, Text Hidden */
.date-display-mobile {
    display: none;
}

.date-input-real {
    position: relative;
    opacity: 1;
    max-width: 160px;
    /* PC Width */
    cursor: pointer;
    background-color: var(--bg-input);
    border: 1px solid var(--border-input);
    color: var(--text-main);
}

@media (min-width: 769px) {

    /* Ensure styles applied on PC */
    .date-input-real {
        padding: 6px;
        border-radius: var(--radius-main);
    }
}

/* Mobile Mode: Mask Pattern */
@media (max-width: 768px) {
    .date-display-mobile {
        display: block;
        width: 105px !important;
        /* Mobile fixed width */
        text-align: center;
        padding-right: 0;
        background-color: var(--bg-input);
        /* Ensure theme color */
        color: var(--text-main);
        border: 1px solid var(--border-input);
        border-radius: var(--radius-main);
        height: 38px;
        /* Match Select height usually */
    }

    .date-input-real {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
        /* Invisible clickable overlay */
        z-index: 5;
        max-width: none;
        /* Fill container */
    }
}

/* ========================================= */
/* 2. 導航與篩選 (Navigation) */
/* ========================================= */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-main) var(--radius-main) 0 0;
    overflow: hidden;
}

.tab-item {
    flex: 1;
    text-align: center;
    padding: 15px;
    cursor: pointer;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.2s;
    background-color: var(--bg-card);
}

.tab-item:hover {
    color: var(--c-brand-blue);
    background-color: var(--bg-hover);
}

.tab-item.active {
    color: var(--c-brand-blue);
    border-bottom-color: var(--c-brand-blue);
    background-color: var(--bg-status-info);
}

.control-panel,
.context-switcher,
.board-header,
.page-header {
    background: var(--bg-card);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    box-shadow: var(--shadow-soft);
}

.control-header {
    background: var(--bg-card);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    box-shadow: var(--shadow-soft);
    border-radius: var(--radius-main);
}

.community-selector,
.comm-select,
.context-selector select {
    padding: 8px 12px;
    font-size: 1rem;
    border: 1px solid var(--border-input);
    border-radius: 4px;
    background-color: var(--bg-input);
    color: var(--text-main);
    cursor: pointer;
    flex-grow: 1;
}

.page-title h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-main);
}

.section-title-accent {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    border-left: 4px solid var(--c-brand-blue);
    padding-left: 10px;
}

.section-title-warning {
    font-size: 1.1rem;
    color: var(--c-brand-orange);
    margin-bottom: 10px;
}

.quota-full-notice {
    color: var(--c-brand-red);
    font-size: 0.85em;
    margin: 5px 0 0 0;
}

/* 選舉與投票組件 */
.election-container {
    padding: 10px 0;
}

.progress-bar {
    background: var(--bg-hover);
    height: 12px;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-fill {
    background: var(--c-brand-green);
    height: 100%;
    transition: width 0.3s;
}

.manifesto-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 10px;
    max-height: 200px;
    object-fit: cover;
}

.role-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
}

.role-Committee {
    background: #e3f2fd;
    color: #1976d2;
}

.role-Staff {
    background: #f5f5f5;
    color: #616161;
}

.role-Interim {
    background: #fff3e0;
    color: #f57c00;
}

[data-theme="dark"] .role-Committee {
    background: #1a237e;
    color: #90caf9;
}

[data-theme="dark"] .role-Staff {
    background: #424242;
    color: #e0e0e0;
}

[data-theme="dark"] .role-Interim {
    background: #4e342e;
    color: #ffb74d;
}

/* 幫助中心布局 */
.col-toc {
    flex: 1 1 250px;
    min-width: 250px;
}

.col-content {
    flex: 3 1 500px;
}

/* 註冊流程與動畫 */
.step-section {
    display: none;
    animation: fadeIn 0.3s;
}

.step-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.template-hint {
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
    display: block;
}

.slot-list-preview {
    background: var(--bg-hover);
    padding: 10px;
    border-radius: 6px;
    margin-top: 5px;
    font-size: 0.9em;
    color: var(--text-secondary);
}

/* 配置選單 (Mini) */
.config-grid-mini {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 6px;
}

.config-row-mini {
    border-bottom: 1px solid var(--bg-hover);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.config-row-mini:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.day-label-mini {
    font-weight: bold;
    color: var(--text-secondary);
    font-size: 0.95em;
    display: block;
    margin-bottom: 5px;
}

/* 頭像與標籤 */
.public-avatar {
    background: var(--bg-status-success);
    color: var(--c-brand-green);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-3xl {
    font-size: 3rem;
    opacity: 0.3;
}

/* ========================================= */
/* 3. 表格與列表 (Tables) */
/* ========================================= */
.unit-table,
.audit-table,
.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-card);
}

.unit-table th,
.audit-table th,
.data-table th {
    background: var(--bg-hover);
    padding: 12px 15px;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: bold;
    white-space: nowrap;
}

.unit-table td,
.audit-table td,
.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    color: var(--text-main);
}

.unit-table tr:hover,
.audit-table tr:hover,
.data-table tr:hover {
    background-color: var(--bg-hover);
}

.amount-pos {
    color: var(--c-brand-red);
    font-weight: bold;
    white-space: nowrap;
}

.amount-neg {
    color: var(--c-brand-green);
    font-weight: bold;
    white-space: nowrap;
}

/* ========================================= */
/* 4. 狀態與標籤 (Badges) */
/* ========================================= */
.status-completed,
.text-success {
    color: var(--c-brand-green);
    font-weight: bold;
}

.status-payment_pending,
.text-danger {
    color: var(--c-brand-red);
    font-weight: bold;
}

.status-canceled {
    color: var(--text-muted);
    text-decoration: line-through;
}

.status-authorize.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid transparent;
}

.badge-status.Reserved,
.badge-status.Authorized {
    background: var(--bg-status-success);
    color: var(--c-brand-green);
    border-color: rgba(143, 175, 154, 0.3);
}

.badge-status.Pending_Owner_Approval,
.badge-status.Payment_Pending {
    background: var(--bg-status-warning);
    color: var(--c-brand-orange);
    border-color: rgba(212, 163, 115, 0.3);
}

.badge-status.Canceled,
.badge-status.Expired {
    background: var(--bg-hover);
    color: var(--text-muted);
    border-color: var(--border-color);
}

.status-authorized {
    color: var(--c-brand-blue);
    font-weight: bold;
}

.status-locked {
    color: var(--c-brand-green);
    font-weight: bold;
}

.badge-System {
    background: var(--bg-status-danger);
    color: var(--c-brand-red);
}

.badge-Community {
    background: var(--bg-status-info);
    color: var(--c-brand-blue);
}

.badge-staff {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.badge-free {
    background: var(--bg-status-warning);
    color: var(--c-brand-orange);
    font-size: 0.8rem;
    padding: 2px 5px;
    border-radius: 4px;
    font-weight: bold;
}

.badge-status {
    background: var(--bg-hover);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--text-secondary);
}

/* ========================================= */
/* 5. 儀表板 (Stats) */
/* ========================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius-main);
    text-align: center;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    border-top-width: 4px;
}

.stat-card.blue {
    border-top-color: var(--c-brand-blue);
}

.stat-card.green {
    border-top-color: var(--c-brand-green);
}

.stat-card.red {
    border-top-color: var(--c-brand-red);
    cursor: pointer;
    transition: 0.2s;
}

.stat-val {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-main);
    display: block;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.action-card {
    background: var(--bg-card);
    padding: 20px 10px;
    border-radius: var(--radius-main);
    text-align: center;
    text-decoration: none;
    color: var(--text-secondary);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.action-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card);
    color: var(--c-brand-blue);
    border-color: var(--c-brand-blue);
}

.action-icon {
    font-size: 2rem;
    color: var(--c-brand-blue);
}

/* ========================================= */
/* 6. 按鈕 (Buttons) */
/* ========================================= */
.btn-action,
.btn-reset,
.btn-remove,
.btn-transfer,
.btn-ctrl {
    padding: 8px 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    color: white;
    font-weight: bold;
    transition: opacity 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-mini {
    padding: 6px 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.9em;
    color: white;
    transition: opacity 0.2s;
}

.btn-reset,
.btn-extend,
.btn-accept {
    background-color: var(--c-brand-orange);
}

.btn-remove,
.btn-reject,
.btn-cancel,
.btn-exit {
    background-color: var(--c-brand-red);
}

.btn-approve,
.btn-entry {
    background: var(--c-brand-green);
}

.btn-end {
    background: var(--c-brand-blue);
}

.btn-noshow {
    background: #90A4AE;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    margin-left: 5px;
}

.btn-edit {
    background: var(--bg-status-info);
    color: var(--c-brand-blue);
}

.btn-delete {
    background: var(--bg-status-danger);
    color: var(--c-brand-red);
}

/* Switch */
.switch,
.switch-sm {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 20px;
    vertical-align: middle;
}

.switch input,
.switch-sm input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider,
.slider-sm {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-input);
    transition: .4s;
    border-radius: 34px;
}

.slider:before,
.slider-sm:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider,
input:checked+.slider-sm {
    background-color: var(--c-brand-blue);
}

input:checked+.slider:before,
input:checked+.slider-sm:before {
    transform: translateX(14px);
}

/* ========================================= */
/* 7. Settings Page */
/* ========================================= */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 20px;
    align-items: start;
}

@media (min-width: 992px) {
    .settings-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.avatar-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    position: relative;
    cursor: pointer;
    width: 120px;
    height: 120px;
    margin-left: auto;
    margin-right: auto;
}

.avatar-preview {
    width: 120px !important;
    height: 120px !important;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-hover);
    background-color: var(--bg-input);
}

.avatar-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 120px !important;
    height: 120px !important;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    font-size: 0.9rem;
}

.avatar-wrapper:hover .avatar-overlay {
    opacity: 1;
}

.switch-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dashed var(--border-color);
}

.switch-label {
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.switch-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: block;
}

.crop-container {
    max-height: 400px;
    width: 100%;
    overflow: hidden;
    background-color: #333;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#cropImage {
    max-width: 100%;
    display: block;
}

.pc-fixed-header {
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    height: 60px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    z-index: 900;
    display: flex;
    align-items: center;
    padding: 0 20px;
    justify-content: space-between;
}

.pc-fixed-header h3 {
    margin: 0;
    color: var(--text-main);
}

.pc-fixed-header span {
    font-size: 0.9rem;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .pc-fixed-header {
        left: 0 !important;
    }
}

/* ========================================= */
/* 8. Community Settings */
/* ========================================= */
.global-rules-box {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 20px;
}

.rule-item {
    flex: 1;
    min-width: 250px;
}

.toggle-group {
    display: inline-flex;
    background: var(--border-color);
    border-radius: 4px;
    padding: 3px;
}

.toggle-group label {
    margin: 0;
    cursor: pointer;
    position: relative;
}

.toggle-group input {
    position: absolute;
    opacity: 0;
}

.toggle-group span {
    display: block;
    padding: 6px 12px;
    border-radius: 3px;
    font-size: 0.9em;
    transition: 0.2s;
    color: var(--text-secondary);
}

.toggle-group input:checked+span {
    background: var(--bg-card);
    color: var(--text-main);
    font-weight: bold;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.pref-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.pref-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.inline-add-form {
    margin: 15px 0;
    padding: 15px 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.form-section-title {
    font-weight: bold;
    color: var(--c-brand-blue);
    width: 100%;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ========================================= */
/* 9. Property & Slot (房產車位) */
/* ========================================= */
.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-main);
    margin-bottom: 30px;
}

.unit-grid,
.slot-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.unit-card,
.slot-card {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.unit-card:hover,
.slot-card:hover {
    transform: translateY(-3px);
    border-color: var(--c-brand-blue);
}

.unit-header,
.card-header {
    padding: 15px;
    background: var(--bg-hover);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
    font-weight: bold;
}

.unit-body,
.slot-card {
    padding: 20px 15px;
    text-align: center;
    color: var(--text-main);
}

.unit-footer {
    padding: 10px 15px;
    background: var(--bg-card);
    border-top: 1px dashed var(--border-color);
    text-align: right;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.slot-no {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-main);
}

.slot-type {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--bg-hover);
    padding: 2px 8px;
    border-radius: 4px;
}

.owner-info {
    display: flex;
    align-items: center;
    margin: 15px 0;
}

.public-tag {
    background: var(--bg-status-success);
    color: var(--c-brand-green);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.price-primary {
    font-size: 1.2rem;
    color: var(--c-brand-orange);
    font-weight: bold;
}

.doc-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed var(--border-color);
}

.doc-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 8px;
}

.hidden-file-input {
    display: none;
}

.btn-upload {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    margin: 0;
}

/* ========================================= */
/* 10. Rental Config Modal (車位出借設定) */
/* ========================================= */
#lendingConfigModal .modal-content {
    max-width: 600px;
    width: 95%;
    margin: 5vh auto;
    max-height: 90vh;
    overflow-y: auto;
}

.price-settings-box {
    background: var(--bg-hover);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.radio-group {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed var(--border-color);
    flex-wrap: wrap;
}

.custom-radio-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-main);
    font-weight: 500;
    position: relative;
    padding: 5px;
}

.custom-radio-option input[type="radio"] {
    -webkit-appearance: none;
    appearance: none;
    background-color: var(--bg-card);
    margin: 0;
    font: inherit;
    color: currentColor;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-input);
    border-radius: 50%;
    display: grid;
    place-content: center;
    cursor: pointer;
}

.custom-radio-option input[type="radio"]::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transform: scale(0);
    transition: 0.15s transform ease-in-out;
    background-color: var(--bg-card);
}

.custom-radio-option input[type="radio"]:checked {
    background-color: var(--c-brand-blue);
    border-color: var(--c-brand-blue);
}

.custom-radio-option input[type="radio"]:checked::before {
    background-color: white;
    transform: scale(1);
}

.price-input-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.price-input-group label {
    font-weight: bold;
    color: var(--c-brand-blue);
    min-width: 120px;
}

.price-input-group input {
    flex: 1;
    max-width: 150px;
    padding: 10px;
    border: 2px solid var(--border-input);
    border-radius: 6px;
    font-size: 1.2em;
    font-weight: bold;
    color: var(--c-brand-blue);
    text-align: right;
    background-color: var(--bg-input);
}

.config-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 5px 2px;
}

.config-row {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    height: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.config-header {
    background: var(--bg-hover);
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.day-label {
    font-weight: bold;
    color: var(--text-main);
    font-size: 1.1em;
}

.config-body {
    padding: 15px;
    display: none;
    background-color: var(--bg-card);
    color: var(--text-main);
    border-top: 1px solid var(--border-color);
}

.config-body.active {
    display: block;
}


.settings-flex-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setting-label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #1565C0;
    font-size: 0.95em;
}

.desktop-divider {
    display: none;
    width: 1px;
    background-color: #cce5ff;
    margin: 0 10px;
}

@media (min-width: 768px) {
    .settings-flex-container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .radio-group-wrapper,
    .price-input-wrapper {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .desktop-divider {
        display: block;
        height: 60px;
    }

    .radio-group {
        justify-content: flex-start;
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0;
    }
}

/* ========================================= */
/* 11. Chat & Notification */
/* ========================================= */
.chat-center-container {
    display: flex;
    height: calc(100vh - 60px);
    margin-top: 60px;
    background: var(--bg-body);
}

.chat-list-col {
    width: 300px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
}

.list-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-hover);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
}

.list-body {
    flex: 1;
    overflow-y: auto;
}

.conversation-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
    background-color: var(--bg-card);
}

.conversation-item:hover {
    background: var(--bg-hover);
}

.conversation-item.active {
    background: var(--bg-status-info);
    border-left: 4px solid var(--c-brand-blue);
}

.sys-admin-item {
    background: var(--bg-status-warning);
    border-bottom: 2px solid var(--border-color);
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.unread-dot {
    width: 10px;
    height: 10px;
    background: var(--c-brand-red);
    border-radius: 50%;
    display: inline-block;
}

.chat-room-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    position: relative;
}

.room-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-body-large {
    flex: 1;
    background-color: var(--bg-body);
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 1.2rem;
    flex-direction: column;
    gap: 10px;
}

.msg-time-group {
    text-align: center;
    font-size: 0.75rem;
    color: white;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 2px 8px;
    align-self: center;
    margin: 10px 0;
}

.fixed-chat-header {
    position: fixed;
    top: 0;
    left: 60px;
    right: 0;
    height: 60px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    z-index: 900;
    display: flex;
    align-items: center;
    padding: 0 20px;
    justify-content: space-between;
    color: var(--text-main);
}

/* ========================================= */
/* 12. Parking Control */
/* ========================================= */
.clock {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--c-brand-blue);
    font-family: monospace;
}

.main-board {
    display: flex;
    height: calc(100vh - 160px);
    gap: 20px;
    padding: 0 20px;
}

.panel {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
}

.panel-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 10;
}

.count-badge {
    background: var(--bg-input);
    color: var(--text-secondary);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.9rem;
}

.count-badge.active {
    background: var(--bg-status-info);
    color: var(--c-brand-blue);
}

.car-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--border-input);
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 8px;
    display: grid;
    grid-template-columns: 1.2fr 1.5fr 1fr;
    gap: 15px;
    align-items: center;
    transition: all 0.2s;
    box-shadow: var(--shadow-soft);
}

.car-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.car-card.incoming {
    border-left-color: var(--c-brand-orange);
    background: var(--bg-status-warning);
}

.car-card.active {
    border-left-color: var(--c-brand-green);
    background: var(--bg-status-success);
}

.card-big-text {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--text-main);
}

.card-sub-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.card-plate {
    font-size: 1.3rem;
    color: var(--text-main);
    font-family: monospace;
    letter-spacing: 1px;
    font-weight: bold;
    border: 2px solid var(--text-main);
    padding: 2px 10px;
    display: inline-block;
    background: var(--bg-card);
    border-radius: 4px;
}

.card-actions {
    grid-column: 3;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.owner-link {
    color: var(--c-brand-blue);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px dashed var(--c-brand-blue);
}

.owner-link:hover {
    color: var(--c-brand-blue-hover);
    border-bottom-style: solid;
}

.public-slot-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    font-size: 1rem;
}

.slot-badge {
    font-weight: bold;
    font-family: monospace;
    font-size: 1.1rem;
    color: var(--text-main);
}

.status-badge {
    text-align: right;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
    justify-self: end;
}

.status-idle {
    background: var(--bg-input);
    color: var(--text-secondary);
}

.status-reserved {
    background: var(--bg-status-warning);
    color: var(--c-brand-orange);
    border: 1px solid var(--c-brand-orange);
}

.status-inuse {
    background: var(--bg-status-success);
    color: var(--c-brand-green);
    border: 1px solid var(--c-brand-green);
}

/* ========================================= */
/* 13. Help & Others */
/* ========================================= */
.announcement-section {
    background: var(--bg-card);
    border-radius: var(--radius-main);
    padding: 20px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
}

.section-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
    border-left: 5px solid var(--c-brand-blue);
    padding-left: 10px;
    display: flex;
    justify-content: start;
    align-items: center;
    color: var(--text-main);
}

.ann-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-main);
    transition: background 0.2s;
}

.ann-item:hover {
    background: var(--bg-hover);
}

.ann-title {
    flex-grow: 1;
    font-weight: 500;
}

.ann-date {
    font-size: 0.85em;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-left: 10px;
}

.qa-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-main);
    margin-bottom: 15px;
    overflow: hidden;
}

.qa-card summary {
    padding: 15px 20px;
    cursor: pointer;
    font-weight: bold;
    color: var(--text-main);
    background-color: var(--bg-hover);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.qa-card summary:hover {
    background-color: var(--bg-input);
}

.qa-card summary::after {
    content: '+';
    font-size: 1.2em;
    color: var(--text-secondary);
}

.qa-card[open] summary::after {
    content: '-';
}

.qa-content {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    line-height: 1.8;
    background-color: var(--bg-card);
}

.brand-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    color: white;
    font-size: 0.8em;
    margin-right: 5px;
    vertical-align: middle;
}

.brand-samsung {
    background-color: #1428A0;
}

.brand-xiaomi {
    background-color: #FF6900;
}

.brand-oppo {
    background-color: #049962;
}

.step-list {
    margin: 10px 0;
    padding-left: 20px;
    color: var(--text-main);
}

.step-list li {
    margin-bottom: 8px;
}

.qa-sub-title {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1rem;
    color: var(--text-main);
}

.qa-note {
    margin-top: 15px;
    font-size: 0.9em;
    color: var(--text-muted);
}

.highlight {
    background-color: var(--bg-status-warning);
    padding: 2px 5px;
    border-radius: 4px;
    font-weight: bold;
    color: #856404;
}

.warning-box {
    background: var(--bg-status-warning);
    color: #856404;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    text-align: left;
    font-size: 0.95em;
    line-height: 1.6;
    margin: 15px 0;
}

.info-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 15px;
    text-align: left;
    margin: 15px 0;
    font-size: 0.95em;
}

.info-label {
    font-weight: bold;
    color: var(--text-secondary);
    text-align: right;
}

.info-value {
    color: var(--text-main);
    font-family: monospace;
}

.empty-state-box {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px dashed var(--border-color);
}

/* ========================================= */
/* 14. RWD Adjustments (Batch 24 Optimized) */
/* ========================================= */
.search-grid-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.datetime-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* 預設 PC: 平均分配空間 */
.datetime-row input,
.datetime-row select {
    flex: 1;
}

@media (min-width: 768px) {
    .search-grid-row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {

    /* 🚨 Batch 24 Fix: 強制橫向排列，且不換行 */
    .datetime-row {
        flex-direction: row !important;
        /* 強制橫向 */
        align-items: center;
        gap: 5px;
        /* 縮小間距 */
        flex-wrap: nowrap;
        /* 禁止換行 */
    }

    /* 日期欄位縮小寬度 (既然已經隱藏年份，寬度可以更小) */
    .datetime-row input[type="date"] {
        flex: 0 0 110px;
        /* 固定寬度，不讓它佔滿 */
        width: 110px;
        margin-bottom: 0;
        padding-left: 2px;
        padding-right: 2px;
        text-align: center;
    }

    /* 時間選單佔滿剩餘空間 */
    .datetime-row select {
        flex: 1;
        width: auto;
        margin-bottom: 0;
        padding-left: 2px;
        padding-right: 2px;
        text-align: center;
        text-align-last: center;
        /* 讓文字居中 */
    }

    /* 其他 RWD 調整保持不變 */
    .unit-table thead,
    .audit-table thead,
    .data-table thead {
        display: none;
    }

    .unit-table tr,
    .audit-table tr,
    .data-table tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 10px;
        background: var(--bg-card);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    .unit-table td,
    .audit-table td,
    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border: none;
        text-align: right;
        border-bottom: 1px dashed var(--border-color);
    }

    .unit-table td:last-child,
    .audit-table td:last-child,
    .data-table td:last-child {
        border-bottom: none;
        display: block;
        margin-top: 10px;
    }

    .unit-table td:before,
    .audit-table td:before,
    .data-table td:before {
        content: attr(data-label);
        font-weight: bold;
        color: var(--text-secondary);
        margin-right: 10px;
    }

    .main-board {
        flex-direction: column;
        height: auto;
        padding: 10px;
    }

    .panel {
        height: auto;
        min-height: 400px;
        margin-bottom: 20px;
    }

    .car-card {
        grid-template-columns: 1fr 1fr;
    }

    .card-actions {
        grid-column: 1 / -1;
        flex-direction: row;
    }

    .request-header,
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .btn-action {
        width: 100%;
        margin-top: 5px;
    }

    .control-panel,
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .inline-add-form {
        flex-direction: column;
        align-items: stretch;
    }

    .inline-add-form input,
    .inline-add-form select,
    .inline-add-form button {
        width: 100% !important;
    }
}

/* Helper Classes */
.mt-2 {
    margin-top: 8px !important;
}

.mt-20 {
    margin-top: 20px !important;
}

.font-bold {
    font-weight: bold !important;
}

.border-none {
    border: none !important;
}

.sub-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.full-width {
    width: 100% !important;
}

/* ================================================================= */
/* 16. Parking Control Specific (Restored for V28.9.0)               */
/* ================================================================= */

/* 強制重置 body 的 padding，避免 global css 干擾 (僅在有 .dashboard-full-height 的頁面生效) */
body:has(.dashboard-full-height) {
    padding-top: 0 !important;
    overflow: hidden;
}

/* 滿版容器設定 */
.dashboard-full-height {
    margin-top: var(--header-height, 60px);
    height: calc(100vh - 90px);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* 控制列：固定高度 */
.pc-control-header {
    flex: 0 0 auto;
    padding: 15px 20px;
    margin: 0 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 主儀表板：填滿剩餘空間 */
.main-board-flex {
    flex: 1;
    display: flex;
    gap: 20px;
    padding: 20px;
    min-height: 0;
    overflow: hidden;
}

/* 左欄 (雙層面板) */
.left-col-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

/* 右欄 & 通用面板 */
.panel-flex {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    padding: 15px;
}

.list-body {
    flex: 1;
    overflow-y: auto;
}

/* Tx ID 顯示樣式 (Debug用) */
.tx-id-tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    vertical-align: middle;
    margin-left: 5px;
    font-family: monospace;
}

/* 遲到專用樣式 (深色模式適應版) */
.car-card.late {
    /* 左側粗紅線 */
    border-left: 5px solid var(--c-brand-red) !important;

    /* 背景色：使用 8% 透明度的紅色疊加，自動適應淺/深色底 */
    background-color: rgba(220, 53, 69, 0.08) !important;

    /* 邊框：帶一點點紅色 */
    border-color: rgba(220, 53, 69, 0.3) !important;
}

/* RWD 調整 */
@media (max-width: 768px) {
    body:has(.dashboard-full-height) {
        overflow: auto;
    }

    /* 手機版恢復捲軸 */

    .dashboard-full-height {
        height: auto;
        margin-top: var(--header-height, 60px);
        min-height: calc(100vh - 60px);
        overflow: visible;
    }

    .main-board-flex {
        flex-direction: column;
        height: auto;
        padding: 10px;
    }

    .panel-flex {
        height: 400px;
        min-height: 400px;
    }
}

/* =========================================
   Slot Item Layout (簡約佈局擴充)
   ========================================= */

.slot-item {
    /* 基礎卡片樣式 (沿用變數) */
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-main);
    box-shadow: var(--shadow-soft);
    margin-bottom: 15px;
    overflow: hidden;

    /* 預設佈局 (手機版垂直堆疊) */
    display: flex;
    flex-direction: column;
}

/* 左側邊框狀態色 (沿用現有顏色變數) */
.slot-item.verified {
    border-left: 5px solid var(--c-brand-green);
}

.slot-item.pending {
    border-left: 5px solid var(--c-brand-orange);
}

.slot-item.rejected {
    border-left: 5px solid var(--c-brand-red);
}

.slot-item.conflict {
    border-left: 5px solid #ab47bc;
}

/* 內部區塊通用設定 */
.slot-cell {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    /* 手機版分隔線 */
}

.slot-cell:last-child {
    border-bottom: none;
}

/* 1. 頭部 (號碼) */
.slot-head {
    display: flex;
    justify-content: space-between;
    /* 手機版左右撐開 */
    align-items: center;
    background: var(--bg-hover);
    /* 淺灰背景區隔 */
}

.slot-num-text {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-main);
}

/* 2. 內容 (資訊) */
.slot-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 3. 底部 (操作) */
.slot-foot {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

/* ===== PC 版佈局覆寫 (>= 769px) ===== */
@media (min-width: 769px) {
    .slot-item {
        flex-direction: row;
        /* 轉為橫向 */
        align-items: center;
        /* 垂直置中 */
    }

    .slot-cell {
        border-bottom: none;
        /* 移除水平分隔線 */
        border-right: 1px solid var(--border-color);
        /* 改為垂直分隔線 */
    }

    .slot-cell:last-child {
        border-right: none;
    }

    /* 頭部：固定寬度、垂直置中 */
    .slot-head {
        width: 150px;
        min-width: 150px;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        align-self: stretch;
        /* 撐滿高度 */
    }

    /* 內容：橫向排列 */
    .slot-body {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

/* =========================================
   Lending Config UI (還原 UI 樣式)
   ========================================= */

/* 1. 外框與手風琴 */
.config-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.config-row {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    overflow: hidden;
    transition: all 0.2s;
}

.config-row.active {
    border-color: var(--c-brand-blue);
    box-shadow: 0 0 5px rgba(33, 150, 243, 0.1);
}

.config-header {
    background: var(--bg-hover);
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: default;
}

.config-body {
    display: none;
    /* 預設隱藏 */
    padding: 15px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

.config-body.active {
    display: block;
    /* JS 控制顯示 */
    animation: fadeIn 0.2s ease-in-out;
}

/* 2. 時間選擇器行 */
.time-slots-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.time-slot-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-input);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
}

/* 3. 下拉選單群組 */
.time-group {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 5px;
}

.t-sel {
    border: none;
    background: transparent;
    font-family: monospace;
    font-size: 1.1em;
    font-weight: bold;
    color: var(--text-main);
    padding: 5px 2px;
    cursor: pointer;
    appearance: none;
    /* 移除瀏覽器預設樣式 */
    -webkit-appearance: none;
    text-align: center;
}

.t-sel:focus {
    outline: none;
    background: var(--bg-hover);
}

/* 4. 按鈕與開關 */
.custom-time-btn-wrap {
    margin-top: 10px;
    text-align: center;
}

.btn-add-time {
    border: 1px dashed var(--c-brand-blue);
    color: var(--c-brand-blue);
    background: transparent;
    width: 100%;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

.btn-add-time:hover {
    background: var(--bg-status-info);
}

.remove-time {
    color: var(--c-brand-red);
    cursor: pointer;
    font-size: 1.2em;
    margin-left: auto;
    transition: transform 0.2s;
}

.remove-time:hover {
    transform: scale(1.1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Batch 36: Toast & System Alert Styles --- */

/* 1. Toast (右上方浮動訊息) */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 12000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    /* 讓點擊穿透 */
}

.toast {
    background: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    max-width: 300px;
    animation: slideInRight 0.3s, fadeOut 0.5s 2.5s forwards;
    pointer-events: auto;
    /* 恢復自身點擊 */
}

.toast i {
    font-size: 1.1em;
}

.toast.success {
    background: var(--c-brand-green);
}

.toast.error {
    background: var(--c-brand-red);
}

.toast.warning {
    background: var(--c-brand-orange);
}

.toast.info {
    background: var(--c-brand-blue);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* 2. System Alert Modal (取代 window.alert) */
#systemAlertModal {
    z-index: 13000;
}

#systemAlertModal .modal-content {
    text-align: center;
    max-width: 400px;
}

.alert-icon-box {
    font-size: 3rem;
    margin-bottom: 15px;
}

.alert-btn {
    width: 100%;
    padding: 10px;
    margin-top: 20px;
    font-size: 1rem;
}

/* 候選人卡片與倒數計時 */
.candidate-card {
    background: var(--bg-card);
    padding: 15px;
    border-radius: var(--radius-main);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    margin-bottom: 20px;
    /* 防止寬度溢出 */
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.countdown-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.countdown-warning {
    background: #fff3e0;
    color: #f57c00;
}

.countdown-danger {
    background: #ffebee;
    color: #c62828;
}

[data-theme="dark"] .countdown-warning {
    background: #4e342e;
    color: #ffcc80;
}

[data-theme="dark"] .countdown-danger {
    background: #3e2723;
    color: #ffab91;
}

/* ========================================= */
/* 20. Mobile Responsive Tables (Batch 45) */
/* ========================================= */
@media (max-width: 768px) {

    .unit-table,
    .audit-table,
    .data-table {
        min-width: 100% !important;
        display: block;
    }

    .unit-table thead,
    .audit-table thead,
    .data-table thead {
        display: none;
    }

    .unit-table tbody,
    .audit-table tbody,
    .data-table tbody {
        display: block;
        width: 100%;
    }

    .unit-table tr,
    .audit-table tr,
    .data-table tr {
        display: block;
        margin-bottom: 20px;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-main);
        box-shadow: var(--shadow-sm);
        padding: 15px;
    }

    .unit-table td,
    .audit-table td,
    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border-bottom: 1px dashed var(--border-color);
        text-align: right;
        min-height: 40px;
        flex-wrap: wrap;
    }

    .unit-table td:last-child,
    .audit-table td:last-child,
    .data-table td:last-child {
        border-bottom: none;
        justify-content: flex-end;
        padding-bottom: 0;
    }

    .unit-table td::before,
    .audit-table td::before,
    .data-table td::before {
        content: attr(data-label);
        font-weight: bold;
        color: var(--text-secondary);
        margin-right: 15px;
        text-align: left;
        flex-shrink: 0;
        /* Ensure label doesn't wrap weirdly */
        width: 100px;
    }

    /* Specific adjustments */
    .unit-table td[data-label="操作"],
    .unit-table td[data-label="Action"],
    .data-table td[data-label="操作"] {
        justify-content: flex-end;
    }

    .unit-table td[data-label="操作"]::before {
        display: none;
        /* Hide label for actions row to save space */
    }

    /* Right align value content */
    .unit-table td>*:not(::before) {
        text-align: right;
        margin-left: auto;
        /* Push content to right */
    }
}