:root {
    --color-primary: #4f46e5;
    --color-danger: #dc2626;
    --color-success: #16a34a;
    --color-warning: #f59e0b;
    --wave-red: #dc2626;
    --wave-blue: #2563eb;
    --wave-green: #16a34a;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Stats table */
.stats-table { border-collapse: collapse; width: 100%; }
.stats-table td { padding: 2px 4px; border-bottom: 1px solid #f1f5f9; font-size: 12px; line-height: 20px; }
.stats-table tr:hover { background: #f8fafc; }

/* Ball chip */
.ball-chip {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 50%;
    font-size: 12px; font-weight: 600; color: #fff;
}
.ball-chip.red   { background: var(--wave-red); }
.ball-chip.blue  { background: var(--wave-blue); }
.ball-chip.green { background: var(--wave-green); }

/* Amount coloring */
.amt-pos { color: var(--color-success); }
.amt-neg { color: var(--color-danger); font-weight: 600; }

/* Lottery tag pills */
.lot-tag { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.lot-tag-new  { background: #dcfce7; color: #166534; }
.lot-tag-old  { background: #f3e8ff; color: #6b21a8; }
.lot-tag-hk   { background: #fef9c3; color: #854d0e; }

/* Play pill */
.play-pill {
    display: inline-block; padding: 2px 8px; border-radius: 9999px;
    font-size: 11px; background: #e0e7ff; color: #3730a3;
}
.play-pill.win { background: #fef3c7; color: #92400e; }

/* Toast notification */
.toast {
    position: fixed; top: 50%; left: 50%; z-index: 9999;
    padding: 12px 28px; border-radius: 8px; font-size: 14px; font-weight: 600;
    box-shadow: 0 6px 24px rgba(0,0,0,0.25);
    transform: translate(-50%, -50%) scale(0.7); opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
    pointer-events: none; text-align: center; max-width: 80vw;
}
.toast.show { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }
.toast.success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.toast.error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.toast.info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* Loading spinner */
.spinner {
    display: inline-block; width: 18px; height: 18px;
    border: 2px solid #e2e8f0; border-top-color: var(--color-primary);
    border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Card */
.card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; }

/* Modal */
.modal-overlay {
    position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.4);
    display: flex; align-items: center; justify-content: center;
}
.modal-box {
    background: #fff; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    max-width: 480px; width: 90%; max-height: 80vh; overflow-y: auto; padding: 24px;
}

/* Btn helpers */
.btn {
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
    padding: 6px 16px !important; border-radius: 8px !important; font-size: 13px !important; font-weight: 500 !important;
    cursor: pointer; transition: all 0.15s; border: none !important; outline: none !important;
    line-height: 1.2 !important;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--color-primary) !important; color: #fff !important; }
.btn-primary:hover:not(:disabled) { background: #4338ca !important; }
.btn-danger { background: var(--color-danger) !important; color: #fff !important; }
.btn-danger:hover:not(:disabled) { background: #b91c1c !important; }
.btn-outline {
    background: #fff !important; color: #475569 !important; border: 1px solid #cbd5e1 !important;
}
.btn-outline:hover:not(:disabled) { background: #f8fafc !important; }
.btn-sm { padding: 4px 10px !important; font-size: 12px !important; }

/* Input */
.input {
    width: 100%; border: 1px solid #cbd5e1; border-radius: 8px;
    padding: 8px 12px; font-size: 13px; outline: none; transition: all 0.15s;
    background: #f8fafc;
}
.input:focus { border-color: var(--color-primary); background: #fff; box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }

/* ====== Topbar (single row) ====== */
.topbar {
    background: linear-gradient(to right, #3730a3, #4338ca) !important;
    height: 36px !important; padding: 0 10px !important;
    display: flex !important; align-items: center !important; gap: 6px !important;
    overflow-x: auto; flex-shrink: 0;
    scrollbar-width: none; -ms-overflow-style: none;
}
.topbar::-webkit-scrollbar { display: none; }
.topbar-title {
    color: #fff !important; font-weight: 800 !important; font-size: 15px !important;
    white-space: nowrap; margin-right: 6px;
}
.tb-btn {
    height: 26px !important; padding: 0 12px !important; border-radius: 13px !important;
    font-size: 12px !important; font-weight: 700 !important; white-space: nowrap;
    border: none !important; cursor: pointer; text-decoration: none !important;
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
    transition: opacity 0.15s; flex-shrink: 0;
    line-height: 1 !important; box-sizing: border-box !important;
}
.tb-btn:hover { opacity: 0.85; }
.tb-orange { background: #ea580c !important; color: #fff !important; }
.tb-green  { background: #16a34a !important; color: #fff !important; }
.tb-yellow { background: #eab308 !important; color: #1a1a1a !important; }
.tb-ghost  { background: rgba(255,255,255,0.18) !important; color: #fff !important; }
.tb-blue   { background: rgba(255,255,255,0.2) !important; color: #e0e7ff !important; }
.tb-blue:hover { background: rgba(255,255,255,0.35) !important; color: #fff !important; }
.tb-red    { background: #dc2626 !important; color: #fff !important; }
.tb-text   { font-size: 12px !important; color: #c7d2fe !important; white-space: nowrap; }
.tb-sep    { width: 1px; height: 20px; background: rgba(255,255,255,0.3); margin: 0 4px; flex-shrink: 0; }

/* ====== Page Modal Base ====== */
.page-modal {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
}
.pm-box {
    background: #fff; border-radius: 12px;
    width: 95vw; max-height: 90vh;
    display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    overflow: hidden;
}
.pm-box.pm-fullscreen {
    width: 100vw; height: 100vh; max-height: 100vh;
    border-radius: 0;
}
.pm-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}
.pm-head h3 { font-size: 15px; font-weight: 700; color: #1e293b; margin: 0; }
.pm-body { padding: 12px 16px; overflow-y: auto; flex: 1; min-height: 0; }
.pm-x {
    background: none; border: none; font-size: 22px;
    color: #94a3b8; cursor: pointer; line-height: 1; padding: 0 4px;
}
.pm-x:hover { color: #475569; }
.pm-x-prominent { font-size: 26px; color: #dc2626; }
.pm-x-prominent:hover { color: #991b1b; }

/* ====== Play Entry Modal ====== */
.pe-hint { font-size: 11px; color: #64748b; margin-bottom: 6px; font-weight: 600; }
.pe-menu-btn {
    display: block; width: 100%; padding: 10px 14px; margin-bottom: 6px;
    border: none; border-radius: 8px; font-size: 13px; font-weight: 700;
    color: #fff; cursor: pointer; text-align: left;
}
.pe-menu-btn:hover { opacity: 0.9; }
.pe-sel-btn {
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid #d1d5db; border-radius: 6px; cursor: pointer;
    font-weight: 600; background: #fff; transition: all 0.12s;
    padding: 4px 2px; font-size: 12px; min-height: 30px;
}
.pe-sel-btn:hover { opacity: 0.85; }
.pe-sel-btn.pe-zodiac { min-width: 48px; font-size: 13px; }
.pe-sel-btn.pe-tail { min-width: 40px; font-size: 13px; }
.pe-sel-btn.pe-face { min-width: 44px; font-size: 12px; }
.pe-sel-btn.pe-num { min-width: 30px; font-size: 13px; font-weight: 700; }
.pe-sel-btn.pe-tema {
    min-width: 40px; font-size: 11px; font-weight: 700;
    color: #fff; border: 2px solid transparent;
}
.pe-sel-btn.pe-tema.active {
    border-color: #f59e0b; box-shadow: 0 0 0 2px #fbbf24;
}
.pe-type-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 600;
    cursor: pointer; border: 1px solid #d1d5db; background: #fff; color: #374151;
}
.pe-type-btn.active { background: #7c3aed; color: #fff; border-color: #7c3aed; }
.pe-preset-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 600;
    cursor: pointer; border: 1px solid #d1d5db; background: #f9fafb; color: #374151;
}
.pe-preset-btn:hover { background: #e5e7eb; }

/* Pending groups column */
.pe-pending-col {
    width: 340px; flex-shrink: 0; border-right: 1px solid #e2e8f0;
    padding-right: 8px; display: flex; flex-direction: column; gap: 4px;
    max-height: 400px; overflow-y: auto;
}
.pe-pending-title {
    font-size: 11px; font-weight: 700; color: #475569; margin-bottom: 2px;
    border-bottom: 1px solid #e2e8f0; padding-bottom: 3px;
}
.pe-pending-list { display: flex; flex-direction: column; gap: 3px; }
.pe-pending-item {
    display: flex; align-items: center; gap: 4px; font-size: 10px;
    background: #f1f5f9; border-radius: 4px; padding: 3px 4px; line-height: 1.3;
}
.pe-pending-item .pe-grp-label {
    font-weight: 700; color: #475569; white-space: nowrap; flex-shrink: 0;
}
.pe-pending-item .pe-grp-nums {
    flex: 1; min-width: 0; color: #1e293b; word-break: break-all;
}
.pe-pending-item .pe-grp-del {
    width: 16px; height: 16px; border: none; background: none; color: #ef4444;
    cursor: pointer; font-size: 13px; font-weight: 700; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.pe-pending-item .pe-grp-del:hover { color: #b91c1c; }

/* Inline pending groups (shown when pending col is not used) */
.pe-pending-inline {
    margin-top: 6px; padding: 4px 6px; background: #f8fafc;
    border: 1px solid #e2e8f0; border-radius: 6px; font-size: 10px;
    max-height: 100px; overflow-y: auto;
}

/* 下一组 button */
.pe-next-group-btn {
    padding: 2px 10px; border-radius: 4px; font-size: 11px; font-weight: 600;
    border: 1px solid #3b82f6; background: #3b82f6; color: #fff; cursor: pointer;
    white-space: nowrap;
}
.pe-next-group-btn:hover { background: #2563eb; }
.pe-next-group-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Combined grid (tails + zodiac + numbers) */
.pe-comb-row {
    display: flex; gap: 3px; flex-wrap: wrap;
}
.pe-sel-btn.pe-comb-tail {
    flex: 1; min-width: 0; font-size: 11px; padding: 3px 0; text-align: center;
    background: #f0f9ff; border-color: #bae6fd; color: #0369a1;
}
.pe-sel-btn.pe-comb-zodiac {
    flex: 1; min-width: 0; font-size: 11px; padding: 3px 0; text-align: center;
    background: #fefce8; border-color: #fde68a; color: #92400e;
}

/* 各/共 toggle */
.pe-mode-btn {
    padding: 2px 12px; border-radius: 4px; font-size: 11px; font-weight: 700;
    border: 1px solid #d1d5db; background: #fff; color: #374151; cursor: pointer;
}
.pe-mode-btn.active { background: #2563eb; color: #fff; border-color: #2563eb; }

/* X / backspace action buttons in combined grid */
.pe-action-btn {
    border: 1px solid #d1d5db; border-radius: 4px; font-weight: 800;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    min-height: 28px;
}
.pe-x-btn {
    background: #fef3c7; color: #92400e; border-color: #f59e0b; font-size: 14px;
}
.pe-x-btn:hover { background: #fde68a; }

/* Preview box below number grid */
/* Preview row: editable input + always-visible action buttons */
.pe-preview-row {
    margin-top: 6px; display: flex; align-items: center; gap: 4px;
}
.pe-preview-input {
    flex: 1; min-width: 0; height: 30px; padding: 2px 8px;
    border: 1px solid #cbd5e1; border-radius: 4px; background: #f8fafc;
    font-size: 12px; font-weight: 600; color: #1e293b;
    outline: none;
}
.pe-preview-input:focus { border-color: #3b82f6; background: #fff; }
.pe-bet-info-row {
    margin-top: 6px; padding: 3px 0; display: flex; align-items: center;
    justify-content: space-between; flex-wrap: wrap; gap: 4px;
}
.pe-bet-info { font-size: 11px; color: #64748b; }
.pe-bet-info b { color: #059669; }

/* Sequence delete / clear buttons (always visible) */
.pe-seq-del, .pe-seq-clear {
    border: 1px solid #d1d5db; border-radius: 3px; background: #fff;
    cursor: pointer; font-size: 11px; font-weight: 700; padding: 4px 8px;
    flex-shrink: 0; line-height: 1;
}
.pe-seq-del { color: #ea580c; }
.pe-seq-del:hover { background: #fff7ed; }
.pe-seq-clear { color: #dc2626; }
.pe-seq-clear:hover { background: #fef2f2; }

/* Play type toggle buttons row */
.pe-play-btn-row {
    display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap;
}
.pe-play-btn {
    flex: 1; min-width: 0; padding: 5px 4px; border: 1.5px solid #d1d5db;
    border-radius: 4px; background: #f8fafc; color: #475569;
    font-size: 11px; font-weight: 600; cursor: pointer; text-align: center;
    transition: all 0.15s; white-space: nowrap;
}
.pe-play-btn:hover { border-color: #3b82f6; color: #3b82f6; background: #eff6ff; }
.pe-play-btn.pe-play-active {
    border-color: #2563eb; background: #2563eb; color: #fff;
}
.pe-play-btn.pe-play-default { border-style: dashed; }
.pe-play-btn.pe-play-default.pe-play-active {
    border-style: solid; border-color: #2563eb; background: #2563eb; color: #fff;
}

/* ====== Keyword Rules Modal ====== */
.kr-tab-btn {
    padding: 6px 16px; font-size: 12px; font-weight: 600;
    cursor: pointer; border: none; background: #f1f5f9; color: #64748b;
    border-bottom: 2px solid transparent;
}
.kr-tab-btn.active { background: #fee2e2; color: #991b1b; border-bottom-color: #dc2626; }
.kr-tab-page { display: none; padding: 8px; flex: 1; min-height: 0; flex-direction: column; }
/* ── 公共设置 · 归一化分类卡片 ── */
.kr-norm-card { border: 1px solid #e5e7eb; border-radius: 6px; overflow: hidden; }
.kr-norm-hdr {
    display: flex; align-items: center; gap: 0; padding: 2px 6px;
    background: #f9fafb; min-height: 24px; flex-shrink: 0;
}
.kr-norm-lbl { font-size: 11px; font-weight: 700; color: #dc2626; white-space: nowrap; }
.kr-norm-desc { font-size: 10px; color: #000; margin-left: 4px; white-space: nowrap; }
.kr-norm-inp { height: 22px; font-size: 11px; border: 1px solid #d1d5db; border-radius: 3px; padding: 0 4px; width: 90px; }
.kr-norm-arrow { font-size: 11px; font-weight: 700; color: #1e293b; margin: 0 2px; }
.kr-norm-tgt { font-size: 11px; font-weight: 600; color: #dc2626; min-width: 30px; text-align: center; }
.kr-norm-add {
    height: 22px; padding: 0 8px; font-size: 11px; font-weight: 600;
    background: #2563eb; color: #fff; border: none; border-radius: 3px; cursor: pointer;
}
.kr-norm-add:hover { background: #1d4ed8; }
.kr-tags { display: flex; flex-wrap: wrap; gap: 3px; padding: 2px 6px; min-height: 0; }
.kr-tag {
    display: inline-flex; align-items: center; gap: 2px; padding: 1px 8px;
    border-radius: 12px; font-size: 10px; font-weight: 600; min-height: 18px; max-height: 18px;
}
.kr-tag-pin { background: #dc2626; color: #fff; }
.kr-tag-usr { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; cursor: pointer; }
.kr-tag-usr:hover { background: #fef2f2; border-color: #fca5a5; color: #dc2626; }
/* ── 彩种 ── */
.kr-lot-card { border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px; display: flex; flex-direction: column; }
.kr-lot-title { font-size: 13px; font-weight: 700; color: #1e293b; margin-bottom: 8px; }
.kr-lot-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; min-height: 24px; flex: 1; }
.kr-lot-row { display: flex; align-items: center; gap: 8px; }
.kr-lot-inp { flex: 1; height: 26px; font-size: 11px; border: 1px solid #d1d5db; border-radius: 4px; padding: 0 6px; }
.kr-lot-add {
    height: 26px; padding: 0 10px; font-size: 11px; font-weight: 600; min-width: 64px;
    background: #2563eb; color: #fff; border: none; border-radius: 4px; cursor: pointer;
}
.kr-lot-add:hover { background: #1d4ed8; }
/* ── 玩法 · 单行紧凑布局 ── */
.kr-play-cell {
    border: 1px solid #000; padding: 2px 4px;
    display: flex; flex-direction: row; align-items: center; gap: 0;
    min-height: 24px; max-height: 28px; background: #fff;
}
.kr-play-lbl {
    font-size: 11px; font-weight: 600; color: #1e293b; white-space: nowrap;
    min-width: 80px; flex-shrink: 0; border: none; background: transparent; padding: 0 4px;
}
.kr-play-kw {
    font-size: 11px; color: #1e293b; cursor: pointer; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0;
    background: #f1f5f9; height: 20px; line-height: 20px; padding: 0 6px; border: none;
}
.kr-play-kw:hover { color: #2563eb; }
.kr-play-inp {
    height: 20px; font-size: 11px; border: 1px solid #d1d5db; border-radius: 3px;
    padding: 0 4px; width: 70px; flex-shrink: 0; margin-left: 2px;
}
.kr-play-add {
    height: 20px; padding: 0 6px; font-size: 10px; font-weight: 600;
    background: #2563eb; color: #fff; border: none; border-radius: 3px;
    cursor: pointer; flex-shrink: 0; white-space: nowrap; margin-left: 2px;
}
.kr-play-add:hover { background: #1d4ed8; }
.kr-popup-ov { position: fixed; inset: 0; z-index: 350; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; }
.kr-popup-box {
    background: #fff; border-radius: 8px; width: 400px; max-width: 90vw; max-height: 60vh;
    display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.kr-popup-title { font-size: 13px; font-weight: 700; color: #1e293b; padding: 10px 14px; border-bottom: 1px solid #e5e7eb; }
.kr-popup-tags { display: flex; flex-wrap: wrap; gap: 4px; padding: 12px 14px; overflow-y: auto; flex: 1; }

/* ====== Summary Report Modal ====== */
.sr-toolbar { display: flex; align-items: center; gap: 4px; padding: 0; flex-wrap: nowrap; }
.sr-lot-btn { height: 26px; padding: 0 8px; border: 1px solid #d1d5db; background: #fff; color: #374151; font-size: 11px; font-weight: 600; border-radius: 4px; cursor: pointer; transition: all 0.12s; white-space: nowrap; }
.sr-lot-btn.active { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.sr-lot-btn:hover { opacity: 0.85; }
.sr-member-sel { height: 26px; font-size: 11px; border: 1px solid #d1d5db; border-radius: 4px; padding: 0 4px; }
.sr-capsules { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0; align-items: center; }
.sr-pill { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.sr-pill-member { background: #dbeafe; color: #1e40af; }
.sr-pill-count { background: #eef2ff; color: #4338ca; }
.sr-pill-bet { background: #f1f5f9; color: #111827; }
.sr-pill-upstream { background: #fef2f2; color: #dc2626; }
.sr-pill-net { background: #f0fdf4; color: #16a34a; }
.sr-pill-net.neg { color: #dc2626; }
.sr-pill-payout { background: #fffbeb; color: #ca8a04; }
.sr-pill-rebate { background: #f0fdf4; color: #16a34a; }
.sr-pill-pnl { background: #f0fdf4; color: #16a34a; }
.sr-pill-pnl.neg { color: #dc2626; }
.sr-tables { display: flex; gap: 8px; flex: 1; overflow: auto; }
.sr-table-wrap { flex: 1; min-width: 280px; overflow: hidden; }
.sr-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.sr-table thead th { background: #f1f5f9; color: #374151; font-weight: 600; height: 26px; padding: 0 6px; text-align: center; border: 1px solid #e5e7eb; position: sticky; top: 0; z-index: 1; }
.sr-table tbody td { height: 24px; padding: 0 6px; border: 1px solid #e5e7eb; text-align: center; }
.sr-table tbody tr:nth-child(even) { background: #f9fafb; }
.sr-table tbody td.sr-play { text-align: left; font-weight: 500; color: #374151; }
.sr-table tbody td.sr-amt { font-weight: 700; color: #111827; cursor: pointer; }
.sr-table tbody td.sr-amt:hover { background: #dbeafe; }
.sr-table tbody td.sr-amt.neg { color: #dc2626; }
.sr-table tbody td.sr-settle { background: #fff7ed; }
.sr-table tbody td.sr-pnl-pos { color: #16a34a; font-weight: 600; }
.sr-table tbody td.sr-pnl-neg { color: #dc2626; font-weight: 600; }
.sr-table tbody td.sr-win { color: #ca8a04; }
.sr-table tbody td.sr-reb { color: #16a34a; }

/* Summary detail popup */
.sr-detail-ov { position: fixed; inset: 0; z-index: 360; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; }
.sr-detail-box { background: #fff; border-radius: 8px; width: 640px; max-width: 95vw; max-height: 80vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,0.25); }
.sr-detail-hdr { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid #e5e7eb; }
.sr-detail-hdr h4 { font-size: 13px; font-weight: 700; color: #1e293b; margin: 0; }
.sr-detail-close { background: none; border: none; font-size: 18px; color: #64748b; cursor: pointer; }
.sr-detail-body { flex: 1; overflow-y: auto; padding: 10px 14px; }
.sr-detail-group { margin-bottom: 10px; }
.sr-detail-group-title { font-size: 12px; font-weight: 700; color: #1e293b; margin-bottom: 4px; padding: 4px 0; border-bottom: 1px solid #e5e7eb; }
.sr-detail-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.sr-detail-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 6px; font-size: 11px; }
.sr-detail-pill-content { background: #dbeafe; color: #1e40af; font-weight: 600; }
.sr-detail-pill-amt { background: #ffedd5; color: #9a3412; font-weight: 600; }
.sr-detail-pill-amt.neg { background: #fef2f2; color: #dc2626; }
.sr-detail-pill-win { background: #fef9c3; color: #92400e; font-weight: 700; border: 1px solid #d97706; }
.sr-detail-pill-win-label { background: #fee2e2; color: #991b1b; font-weight: 600; }

/* ====== Report top bar (shared settled/unsettled/entrylog) ====== */
.el-back-btn {
    height: 100%; min-height: 36px; padding: 0 14px; font-size: 13px; font-weight: 700;
    background: #ea580c; color: #fff; border: none; border-right: 1px solid #c2410c;
    cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.el-back-btn:hover { background: #c2410c; }
.rpt-topbar {
    display: flex; align-items: center; gap: 0; border-bottom: 1px solid #e5e7eb;
    background: #f8fafc; flex-shrink: 0; min-height: 38px;
    flex-wrap: nowrap; overflow-x: auto;
}
.rpt-title { margin: 0 8px 0 10px; font-size: 14px; font-weight: 700; color: #1c1917; white-space: nowrap; flex-shrink: 0; }
.rpt-lot-strip { display: flex; align-items: center; gap: 3px; flex-shrink: 0; margin-right: 6px; }
.rpt-draw-strip { display: flex; align-items: center; gap: 4px; flex: 1; flex-wrap: nowrap; padding: 2px 4px; min-width: 0; }
.rpt-topbar .el-refresh-btn { margin: 0 6px; flex-shrink: 0; }
.rpt-topbar .btn-sm { margin-right: 4px; flex-shrink: 0; }
.rpt-lot-item {
    display: flex; align-items: center; gap: 2px; padding: 2px 6px;
    border: 1px solid #e5e7eb; border-radius: 6px; background: #fff; cursor: pointer; flex-shrink: 0;
}
.rpt-lot-item.active { border-color: #ea580c; background: #fff7ed; }
.rpt-lot-item .lot-label { font-size: 10px; font-weight: 600; color: #374151; white-space: nowrap; }
.el-toolbar { display: flex; align-items: center; gap: 8px; padding: 6px 16px; background: #fff7ed; border-bottom: 1px solid #fed7aa; flex-wrap: wrap; flex-shrink: 0; }
.el-sel { height: 28px; font-size: 11px; border: 1px solid #d6d3d1; border-radius: 4px; padding: 0 6px; min-width: 80px; background: #fff; }
.el-refresh-btn { height: 28px; padding: 0 12px; font-size: 11px; font-weight: 600; background: #ea580c; color: #fff; border: none; border-radius: 4px; cursor: pointer; }
.el-refresh-btn:hover { background: #c2410c; }
.el-summary-bar { display: flex; align-items: center; gap: 4px; padding: 4px 16px; background: #fafaf9; border-bottom: 1px solid #e7e5e4; font-size: 11px; font-weight: 700; color: #111827; flex-shrink: 0; flex-wrap: wrap; }
.el-tab-bar { display: flex; gap: 0; padding: 0 16px; border-bottom: 1px solid #e5e7eb; flex-shrink: 0; }
.el-tab { height: 32px; padding: 0 18px; font-size: 12px; font-weight: 600; cursor: pointer; border: none; background: #f8fafc; color: #475569; border-bottom: 2px solid transparent; }
.el-tab.active { background: #0284c7; color: #fff; border-bottom-color: #0284c7; }
.el-tab:hover:not(.active) { background: #e2e8f0; }
.el-status { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 9px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.el-status-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.el-status-failed { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }
.el-status-pending { background: #f5f5f4; color: #57534e; border: 1px solid #d6d3d1; }
.el-status-drawn { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.el-detail-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.el-detail-table th { background: #f1f5f9; color: #374151; font-weight: 600; padding: 4px 6px; text-align: center; border: 1px solid #e5e7eb; white-space: nowrap; }
.el-detail-table td { padding: 3px 6px; border: 1px solid #e5e7eb; text-align: center; }
.el-detail-table tr:nth-child(even) { background: #f9fafb; }
.el-detail-table .td-play { text-align: left; font-weight: 600; white-space: nowrap; }
.el-detail-table .td-content { text-align: left; }
.el-detail-table .td-amt { text-align: right; color: #dc2626; font-weight: 700; }
.el-detail-table .el-total-row td { background: #374151; color: #e5e7eb; font-weight: 700; }

/* Page-level summary capsule tags (top bar) */
.el-capsule {
    display: inline-flex; align-items: center; gap: 2px;
    padding: 2px 8px; border-radius: 12px; font-size: 11px;
    background: #dbeafe; border: 1px solid #93c5fd; white-space: nowrap;
}
.el-cap-label { font-weight: 600; color: #1e40af; }
.el-cap-value { font-weight: 700; }

/* Card-level stat capsule tags (per-bet header) */
.bc-capsule {
    display: inline-flex; align-items: center; gap: 2px;
    padding: 1px 6px; border-radius: 10px; font-size: 10px;
    background: #fafaf9; border: 1px solid #e7e5e4; white-space: nowrap;
}
.bc-cap-l { font-weight: 600; color: #78716c; }
.bc-cap-v { font-weight: 700; }

/* Entry log nav buttons for issue strip */
.el-nav-btn {
    width: 20px; height: 20px; border: 1px solid #d1d5db; border-radius: 4px;
    background: #fff; color: #374151; font-size: 14px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0; padding: 0; line-height: 1;
}
.el-nav-btn:hover:not(:disabled) { background: #e5e7eb; }
.el-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* Entry log bet-card scoped */
#elCardList .bet-card + .bet-card { border-top: 1px solid #e5e7eb; }

/* Submit review modal bet-card scoped */
#srCardList .bet-card { border: 1px solid #e5e7eb; border-left: 3px solid #e5e7eb; border-radius: 6px; margin-bottom: 8px; }
#srCardList .bet-card .bet-sep { background: #e5e7eb; }
#srCardList .bet-card .bet-raw-col { border-right-color: #e5e7eb; }
#srCardList .bet-card .bet-mid-col { border-right-color: #e5e7eb; }

/* Wave-colored number chips */
.oc-chip.oc-wave-red { background: #fef2f2; color: #dc2626; border: 1px solid #fca5a5; }
.oc-chip.oc-wave-blue { background: #eff6ff; color: #2563eb; border: 1px solid #93c5fd; }
.oc-chip.oc-wave-green { background: #f0fdf4; color: #059669; border: 1px solid #86efac; }
