* {
    -webkit-tap-highlight-color: transparent;
}

[x-cloak] {
    display: none !important;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    overscroll-behavior: none;
}

input,
select,
textarea {
    -webkit-appearance: none;
    font-size: 16px;
}

.smooth {
    transition: all 0.3s ease;
}

.slide-in {
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 載入遮罩 */
#loader {
    position: fixed;
    inset: 0;
    background: #001524;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #87f5fb;
    font-size: 2rem;
    font-weight: bold;
    transition: opacity 0.5s;
}

/* 提示消息 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 12px;
    font-weight: bold;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    background: #10b981;
    color: white;
}

.toast.error {
    background: #ef4444;
    color: white;
}

.toast.info {
    background: #3b82f6;
    color: white;
}

/* PDF 預覽 */
.pdf-preview {
    width: 100%;
    height: 600px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

/* ======== 設定頁面網格 ======== */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ======== 權限設定 Checkbox (Settings) ======== */
.perm-checkbox {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid #cbd5e1;
    background-color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    margin-right: 8px;
}

.dark .perm-checkbox {
    background-color: #1e293b;
    border-color: #475569;
}

.perm-checkbox:checked {
    background: linear-gradient(135deg, #15616d 0%, #87f5fb 100%);
    border-color: transparent;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(21, 97, 109, 0.4);
}

.perm-checkbox:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-weight: bold;
    font-size: 14px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.perm-checkbox:hover {
    border-color: #87f5fb;
}

/* ======== VIP 餘額扣款 Checkbox (Outbound) ======== */
.vip-checkbox {
    appearance: none;
    -webkit-appearance: none;
    background-color: white;
    cursor: pointer;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    /* 確保在 Tailwind 下有邊框 */
    border-width: 2px;
    border-style: solid;
}

/* 被勾選時的背景色 (配合 Indigo 主題) */
.vip-checkbox:checked {
    background-color: #4f46e5; /* Indigo-600 */
    border-color: #4f46e5;
}

/* 畫出打勾符號 */
.vip-checkbox:checked::after {
    content: '✓';
    color: white;
    font-size: 1.2rem;
    font-weight: 900;
    line-height: 1;
}
/* ======== 強制修復剔選框樣式 ======== */
.table-checkbox {
    -webkit-appearance: none;
    appearance: none;
    width: 24px; /* 加大尺寸 */
    height: 24px;
    border: 2px solid #cbd5e1; /* 灰色邊框 */
    border-radius: 6px;
    background-color: white;
    cursor: pointer;
    position: relative;
    display: inline-block;
    vertical-align: middle;
    transition: all 0.2s ease;
}

/* 勾選後的狀態 (藍底白勾) */
.table-checkbox:checked {
    background-color: #2563eb; /* Blue-600 */
    border-color: #2563eb;
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
}

/* 滑鼠懸停 */
.table-checkbox:hover {
    border-color: #2563eb;
}