/* AdminLTE 3 相容覆寫 - 保留舊模板殘留 class 與輕量微調 */

body { background-color: #f4f6f9; }

.content-wrapper { background-color: #f4f6f9; min-height: calc(100vh - 57px - 57px); }
.content-wrapper > .content { padding: 20px; }
.content-wrapper > .content-header { padding: 15px 0.5rem; }

.brand-link { padding: 0.8125rem 0.5rem; }
.brand-link .brand-text strong { font-size: 1.1rem; letter-spacing: 0.4px; }
.brand-link .brand-text small { font-size: 11px; letter-spacing: 1px; opacity: 0.7; }

.user-menu .user-header { padding: 12px 16px; color: #fff; }
.user-menu .user-header small { color: rgba(255,255,255,0.75); }

/* === 頂部水平導航 (layout-top-nav) === */
.layout-top-nav .main-header.top-nav-bar {
	background: #007bff;
	border-bottom: 0;
	padding: 0 16px;
	min-height: 56px;
	box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}
.layout-top-nav .main-header.top-nav-bar .navbar-brand {
	color: #fff;
	font-size: 16px;
	letter-spacing: 0.5px;
	padding: 0 18px;
	margin: 0 12px 0 0;
	height: 56px;
	display: inline-flex;
	align-items: center;
	background: rgba(0,0,0,0.12);
}
.layout-top-nav .main-header.top-nav-bar .navbar-brand strong { font-weight: 700; }
.layout-top-nav .top-nav-menu .nav-item .nav-link {
	color: rgba(255,255,255,0.92);
	padding: 18px 16px;
	font-size: 14px;
	font-weight: 500;
	border-bottom: 2px solid transparent;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}
.layout-top-nav .top-nav-menu .nav-item .nav-link:hover {
	color: #fff;
	background: rgba(0,0,0,0.08);
}
.layout-top-nav .top-nav-menu .nav-item .nav-link.active {
	color: #fff;
	background: rgba(255,255,255,0.14);
	border-bottom-color: #fff;
}
.layout-top-nav .top-nav-user .nav-link {
	color: #fff !important;
	padding: 18px 14px;
	font-weight: 500;
}
.layout-top-nav .top-nav-user .nav-link:hover { background: rgba(0,0,0,0.08); }
.layout-top-nav .top-nav-user .user-menu .dropdown-menu { min-width: 220px; padding: 0; }
.layout-top-nav .top-nav-user .user-menu .user-header { padding: 14px 16px; }
.layout-top-nav .top-nav-user .user-menu .dropdown-item { padding: 10px 16px; font-size: 13px; }
.layout-top-nav .content-wrapper { margin-left: 0 !important; }
.layout-top-nav .main-footer { margin-left: 0 !important; }

@media (max-width: 767.98px) {
	.layout-top-nav .main-header.top-nav-bar { padding: 0 8px; }
	.layout-top-nav .main-header.top-nav-bar .navbar-brand { padding: 0 10px; margin-right: 4px; }
	.layout-top-nav .top-nav-menu .nav-item .nav-link { padding: 12px 14px; border-bottom: 0; border-left: 3px solid transparent; }
	.layout-top-nav .top-nav-menu .nav-item .nav-link.active { border-left-color: #fff; border-bottom: 0; }
}

.page-title-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.page-title-bar .page-title { font-size: 18px; font-weight: 600; margin: 0; color: #2b3035; }
.page-title-bar .breadcrumb { background: transparent; padding: 0; margin: 0; }

.card { box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 0; }
.card .card-header { background-color: #fff; border-bottom: 1px solid #f1f3f6; }
.card .card-title { font-size: 14px; font-weight: 600; }

.btn { font-weight: 500; }
.btn .icon-reset, .btn .icon-search4, .btn .icon-cog3, .btn .icon-reload, .btn .icon-checkmark { margin-right: 4px; }

.table thead th { background: #f8f9fb; font-weight: 600; font-size: 13px; color: #495057; border-bottom-width: 1px; }
.table td, .table th { vertical-align: middle; font-size: 16px; }
.table-responsive { width: 100%;     white-space: nowrap;}

.pagination { margin: 0; }
.pagination .pagination { display: contents; }

/* === 舊 class 相容 (避免列表頁殘留樣式破版) === */
.bg-teal-400 { background-color: #26a69a !important; color: #fff !important; }
.bg-orange-400 { background-color: #ff9800 !important; color: #fff !important; }
.bg-teal-400:hover, .bg-orange-400:hover { color: #fff !important; opacity: 0.9; }
.text-orange { color: #ff9800 !important; }
.text-teal { color: #26a69a !important; }

/* layer.msg 視覺微調 */
.layui-layer-msg .layui-layer-content { font-size: 14px; }

/* 切換開關 (取代 tp-toggle) */
.toggle { position: relative; display: inline-block; width: 44px; height: 22px; background: #ced4da; border-radius: 22px; cursor: pointer; transition: background-color 0.15s ease; }
.toggle span { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: transform 0.15s ease; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.toggle.on { background: #28a745; }
.toggle.on span { transform: translateX(22px); }
.toggle.toggle-success.on { background: #28a745; }

/* dashboard widget 顏色 */
.icon-tile { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 8px; font-size: 22px; flex-shrink: 0; }
.icon-tile-primary { background: rgba(0,123,255,0.12); color: #007bff; }
.icon-tile-success { background: rgba(40,167,69,0.12); color: #28a745; }
.icon-tile-info { background: rgba(23,162,184,0.12); color: #17a2b8; }
.icon-tile-warning { background: rgba(255,193,7,0.15); color: #fd7e14; }
.icon-tile-danger { background: rgba(220,53,69,0.12); color: #dc3545; }
.icon-tile-secondary { background: rgba(108,117,125,0.12); color: #6c757d; }

/* small text utils 補齊 BS5->BS4 */
.fw-semibold { font-weight: 600 !important; }
.fw-bold { font-weight: 700 !important; }
.fs-11 { font-size: 11px !important; }
.fs-12 { font-size: 12px !important; }
.fs-13 { font-size: 13px !important; }
.fs-14 { font-size: 14px !important; }
.fs-15 { font-size: 15px !important; }
.fs-16 { font-size: 16px !important; }
.fs-18 { font-size: 18px !important; }
.fs-20 { font-size: 20px !important; }
.fs-22 { font-size: 22px !important; }
.fs-24 { font-size: 24px !important; }
.fs-28 { font-size: 28px !important; }
.lh-1 { line-height: 1 !important; }
.op-7 { opacity: 0.7 !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.gy-3 > * { margin-bottom: 1rem; }
.gy-4 > * { margin-bottom: 1.5rem; }

/* BS5 邊距 class 對映 BS4 (避免 ms-/me-/ps-/pe- 失效) */
.ms-1 { margin-left: 0.25rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.ms-3 { margin-left: 1rem !important; }
.ms-md-1 { margin-left: 0.25rem !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.me-3 { margin-right: 1rem !important; }
.ps-3 { padding-left: 1rem !important; }
.ps-0 { padding-left: 0 !important; }
.pe-3 { padding-right: 1rem !important; }
@media (min-width: 768px){
	.ms-md-0 { margin-left: 0 !important; }
}

/* alert 微調 */
.alert { border: 0; background-color: #f1f5f9; color: #475569; }
.alert-danger { background-color: rgba(220,53,69,0.08); color: #b02a37; }
.alert-warning { background-color: rgba(255,193,7,0.12); color: #997404; }
.alert-info { background-color: rgba(23,162,184,0.1); color: #0c6378; }
.alert-success { background-color: rgba(40,167,69,0.1); color: #1e7e34; }

/* tp-* 殘留 class 友善處理 */
.tp-form-card, .tp-table-card, .tp-ecom-card, .tp-home-panel-card { background: #fff; }
.tp-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 0; }
.tp-toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ui-card-stack > .card { margin-bottom: 1rem; }

/* ===== 全新頁面設計元件 (home/buyPackage/account/allStat) ===== */
.page-hero { padding: 18px 0 8px; }
.page-hero .page-hero-title { font-size: 20px; font-weight: 700; color: #1f2937; margin: 0; letter-spacing: 0.3px; }
.page-hero .page-hero-sub { font-size: 13px; color: #6b7280; margin-top: 4px; }
.page-hero .breadcrumb { background: transparent; padding: 0; margin: 0; font-size: 12px; }
.page-hero .breadcrumb-item + .breadcrumb-item::before { color: #cbd5e1; }
.page-hero .breadcrumb-item a { color: #6366f1; }

/* 精緻 metric card */
.metric-card { position: relative; background: #fff; border-radius: 14px; padding: 20px 22px; box-shadow: 0 1px 3px rgba(15,23,42,0.04), 0 2px 14px rgba(15,23,42,0.04); border: 1px solid #eef1f5; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.metric-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(15,23,42,0.08); }
.metric-card .metric-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.metric-card .metric-label { font-size: 13px; color: #64748b; font-weight: 500; letter-spacing: 0.2px; }
.metric-card .metric-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 18px; color: #fff; }
.metric-card .metric-icon.bg-grad-blue { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.metric-card .metric-icon.bg-grad-green { background: linear-gradient(135deg, #10b981, #34d399); }
.metric-card .metric-icon.bg-grad-orange { background: linear-gradient(135deg, #f59e0b, #f97316); }
.metric-card .metric-icon.bg-grad-purple { background: linear-gradient(135deg, #8b5cf6, #a855f7); }
.metric-card .metric-icon.bg-grad-red { background: linear-gradient(135deg, #ef4444, #f87171); }
.metric-card .metric-icon.bg-grad-cyan { background: linear-gradient(135deg, #06b6d4, #67e8f9); }
.metric-card .metric-icon.bg-grad-pink { background: linear-gradient(135deg, #ec4899, #f472b6); }
.metric-card .metric-icon.bg-grad-slate { background: linear-gradient(135deg, #64748b, #94a3b8); }
.metric-card .metric-value { font-size: 28px; font-weight: 700; color: #0f172a; line-height: 1.15; letter-spacing: -0.5px; }
.metric-card .metric-foot { font-size: 12px; color: #94a3b8; margin-top: 6px; }
.metric-card .metric-foot .text-up { color: #10b981; }
.metric-card .metric-foot .text-down { color: #ef4444; }

/* panel-card 統一白卡 */
.panel-card { background: #fff; border-radius: 14px; box-shadow: 0 1px 3px rgba(15,23,42,0.04), 0 2px 14px rgba(15,23,42,0.04); border: 1px solid #eef1f5; padding: 22px; margin-bottom: 24px; }
.panel-card .panel-title { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; color: #0f172a; margin: 0 0 16px; }
.panel-card .panel-title .panel-title-bar { width: 4px; height: 18px; border-radius: 2px; background: linear-gradient(180deg, #3b82f6, #06b6d4); }
.panel-card .panel-title .panel-title-extra { margin-left: auto; font-size: 12px; color: #64748b; font-weight: 400; }

/* 個資 hero block */
.profile-hero { border-radius: 14px; padding: 22px; color: #fff; background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 55%, #06b6d4 100%); position: relative; overflow: hidden; }
.profile-hero::after { content: ''; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,0.08); }
.profile-hero::before { content: ''; position: absolute; right: 40px; bottom: -60px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,0.06); }
.profile-hero .profile-avatar { width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,0.18); display: inline-flex; align-items: center; justify-content: center; font-size: 26px; }
.profile-hero .profile-username { font-size: 20px; font-weight: 700; letter-spacing: 0.4px; }
.profile-hero .profile-badge { display: inline-block; background: rgba(255,255,255,0.18); color: #fff; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; margin-top: 4px; }
.profile-hero .profile-stat { background: rgba(255,255,255,0.12); border-radius: 10px; padding: 10px 14px; }
.profile-hero .profile-stat .stat-label { font-size: 12px; opacity: 0.85; }
.profile-hero .profile-stat .stat-value { font-size: 16px; font-weight: 700; margin-top: 2px; }

/* pricing card */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.pricing-card { position: relative; background: #fff; border-radius: 14px; border: 1px solid #eef1f5; padding: 22px 20px 20px; box-shadow: 0 1px 3px rgba(15,23,42,0.04); transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease; }
.pricing-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(15,23,42,0.08); border-color: #c7d2fe; }
.pricing-card .pricing-tag { position: absolute; top: 14px; right: 14px; font-size: 11px; padding: 3px 8px; border-radius: 999px; font-weight: 600; }
.pricing-card .pricing-name { font-size: 15px; font-weight: 600; color: #0f172a; margin-bottom: 6px; }
.pricing-card .pricing-desc { font-size: 12px; color: #64748b; margin-bottom: 14px; min-height: 18px; }
.pricing-card .pricing-price { font-size: 30px; font-weight: 700; color: #0f172a; letter-spacing: -0.5px; line-height: 1; }
.pricing-card .pricing-price small { font-size: 13px; color: #94a3b8; font-weight: 500; margin-left: 4px; }
.pricing-card .pricing-meta { font-size: 12px; color: #64748b; padding: 10px 0 14px; border-top: 1px dashed #e2e8f0; margin-top: 14px; }
.pricing-card .pricing-meta .meta-key { color: #94a3b8; margin-right: 6px; }
.pricing-card .pricing-btn { display: block; width: 100%; padding: 9px 0; border-radius: 10px; font-weight: 600; font-size: 13px; }

/* 充值 panel */
.recharge-panel .amount-input { font-size: 22px; font-weight: 700; color: #0f172a; height: 56px; border-radius: 12px; border: 1px solid #e2e8f0; padding-left: 16px; }
.recharge-panel .amount-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 4px rgba(59,130,246,0.1); }
.recharge-panel .quick-amount { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.recharge-panel .quick-amount .q-btn { padding: 6px 14px; border-radius: 999px; border: 1px solid #e2e8f0; background: #f8fafc; color: #475569; font-size: 13px; cursor: pointer; transition: all .15s; }
.recharge-panel .quick-amount .q-btn:hover, .recharge-panel .quick-amount .q-btn.active { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.recharge-panel .pay-method { display: flex; align-items: center; padding: 14px 16px; border-radius: 12px; border: 1px solid #e2e8f0; background: #f8fafc; }
.recharge-panel .pay-method .pay-icon { width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg, #10b981, #34d399); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; margin-right: 12px; }
.recharge-panel .pay-method .pay-name { font-weight: 600; color: #0f172a; }
.recharge-panel .pay-method .pay-sub { font-size: 12px; color: #64748b; }
.recharge-panel .submit-btn { height: 50px; font-size: 15px; font-weight: 600; border-radius: 12px; background: linear-gradient(135deg, #3b82f6, #06b6d4); border: 0; }
.recharge-panel .submit-btn:hover { filter: brightness(1.05); }
.recharge-panel .note-card { border-radius: 12px; padding: 14px 16px; background: #f8fafc; border: 1px solid #e2e8f0; }
.recharge-panel .note-card .note-title { font-size: 13px; font-weight: 600; color: #0f172a; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.recharge-panel .note-card ol, .recharge-panel .note-card ul { padding-left: 18px; margin: 0; font-size: 12px; color: #475569; line-height: 1.7; }

/* 統計表格 */
.stat-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.stat-table thead th { background: #f8fafc; color: #475569; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; padding: 10px 12px; border-bottom: 1px solid #e2e8f0; }
.stat-table tbody td { padding: 12px; border-bottom: 1px solid #f1f5f9; font-size: 13px; color: #334155; }
.stat-table tbody tr:hover td { background: #f8fafc; }
.stat-table .stat-bar { display: inline-block; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #3b82f6, #06b6d4); vertical-align: middle; margin-right: 8px; }

/* 篩選工具列 */
.filter-bar { background: #fff; border-radius: 14px; border: 1px solid #eef1f5; padding: 16px 18px; box-shadow: 0 1px 3px rgba(15,23,42,0.04); margin-bottom: 20px; }
.filter-bar .filter-input { border-radius: 10px; border: 1px solid #e2e8f0; height: 40px; }
.filter-bar .filter-btn { height: 40px; border-radius: 10px; padding: 0 18px; font-weight: 500; }

/* empty state */
.empty-block { padding: 60px 20px; text-align: center; color: #94a3b8; }
.empty-block .empty-icon { font-size: 40px; color: #cbd5e1; margin-bottom: 12px; }
.empty-block .empty-title { font-size: 15px; font-weight: 600; color: #475569; margin-bottom: 4px; }

/* TG bind card */
.tg-card { border-radius: 14px; background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); border: 1px solid #bae6fd; padding: 22px; }
.tg-card .tg-icon { width: 56px; height: 56px; border-radius: 14px; background: linear-gradient(135deg, #0ea5e9, #06b6d4); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 26px; }
.tg-card .tg-code { display: inline-block; padding: 4px 10px; background: #fff; border: 1px dashed #38bdf8; border-radius: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: #0369a1; font-weight: 600; }

/* 表單卡片元件 */
.panel-card .form-section { padding: 16px 0; border-bottom: 1px dashed #eef1f5; }
.panel-card .form-section:last-child { border-bottom: 0; }
.panel-card .form-section .form-label-col { font-weight: 600; color: #334155; padding-top: 8px; font-size: 13px; }
.panel-card .form-section .form-label-col .label-tag { display: inline-block; padding: 2px 8px; font-size: 11px; border-radius: 4px; margin-left: 6px; font-weight: 500; }
.panel-card .form-section .label-tag.tag-warning { background: rgba(245,158,11,0.15); color: #b45309; }
.panel-card .form-section .label-tag.tag-success { background: rgba(16,185,129,0.12); color: #047857; }
.panel-card .form-section .label-tag.tag-info { background: rgba(6,182,212,0.12); color: #0e7490; }
.panel-card .form-control { border-radius: 8px; border: 1px solid #e2e8f0; }
.panel-card .form-control:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.08); }
.panel-card .input-group .form-control { border-radius: 8px 0 0 8px; }
.panel-card .input-group .input-group-append .btn,
.panel-card .input-group .input-group-append .input-group-text { border-radius: 0 8px 8px 0; }

/* 工具列 toolbar */
.action-toolbar { background: #fff; border-radius: 14px; border: 1px solid #eef1f5; padding: 14px 18px; box-shadow: 0 1px 3px rgba(15,23,42,0.04); margin-bottom: 20px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.action-toolbar .toolbar-info { margin-left: auto; color: #64748b; font-size: 13px; }
.action-toolbar .btn { border-radius: 10px; font-weight: 500; }

/* 表格內嵌資訊 */
.cell-title { font-weight: 600; color: #0f172a; font-size: 13px; }
.cell-sub { font-size: 12px; color: #64748b; margin-top: 2px; }
.cell-meta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #64748b; }

/* badge 精修 */
.badge-soft-primary { background: rgba(59,130,246,0.12); color: #2563eb; font-weight: 600; padding: 4px 9px; border-radius: 999px; font-size: 12px; }
.badge-soft-success { background: rgba(16,185,129,0.12); color: #047857; font-weight: 600; padding: 4px 9px; border-radius: 999px; font-size: 12px; }
.badge-soft-warning { background: rgba(245,158,11,0.15); color: #b45309; font-weight: 600; padding: 4px 9px; border-radius: 999px; font-size: 12px; }
.badge-soft-danger { background: rgba(239,68,68,0.12); color: #b91c1c; font-weight: 600; padding: 4px 9px; border-radius: 999px; font-size: 12px; }
.badge-soft-info { background: rgba(6,182,212,0.12); color: #0e7490; font-weight: 600; padding: 4px 9px; border-radius: 999px; font-size: 12px; }

