:root {
    --bg-main: #0a0a14;
    --bg-card: #121224;
    --bg-card-header: #181830;
    --bg-input: #1b1b36;
    --border-color: #26264d;
    --border-highlight: #3c3c78;
    
    --primary: #00ff88;
    --primary-glow: rgba(0, 255, 136, 0.25);
    --primary-hover: #00cc6a;
    
    --live-color: #00ff88;
    --live-bg: rgba(0, 255, 136, 0.08);
    --live-border: rgba(0, 255, 136, 0.3);
    
    --die-color: #ff4d4d;
    --die-bg: rgba(255, 77, 77, 0.08);
    --die-border: rgba(255, 77, 77, 0.3);
    
    --unk-color: #a0a0ff;
    --unk-bg: rgba(160, 160, 255, 0.08);
    --unk-border: rgba(160, 160, 255, 0.3);
    
    --text-main: #e2e8f0;
    --text-muted: #8e8ea8;
    --text-dim: #5c5c7d;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    
    --font-sans: 'Plus Jakarta Sans', 'Kantumruy Pro', sans-serif;
    --font-mono: 'Fira Code', 'Consolas', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    font-size: 14px;
}

/* Ambient glow backgrounds */
.ambient-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(140px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.12;
}

.glow-1 {
    top: -200px;
    left: 20%;
    background: radial-gradient(circle, #00ff88, transparent);
}

.glow-2 {
    bottom: -200px;
    right: 10%;
    background: radial-gradient(circle, #6366f1, transparent);
}

.app-container {
    position: relative;
    z-index: 1;
    max-width: 1240px;
    margin: 0 auto;
    padding: 16px 20px 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Top Header ── */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(18, 18, 36, 0.7);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 18px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-wrapper {
    position: relative;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-img {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

.brand-title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge-tag {
    font-size: 10px;
    font-weight: 700;
    background: linear-gradient(135deg, #00ff88, #00b359);
    color: #000000;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
}

.brand-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.visitor-counter-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(160, 160, 255, 0.08);
    border: 1px solid rgba(160, 160, 255, 0.25);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-main);
}

.vis-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.vis-item b {
    color: var(--primary);
}

.vis-sep {
    color: var(--text-dim);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 255, 136, 0.08);
    border: 1px solid rgba(0, 255, 136, 0.25);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
}


.dot-online {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--primary);
    box-shadow: 0 0 8px var(--primary);
    animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.tele-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #1e1e3f;
    color: #ffffff;
    text-decoration: none;
    padding: 7px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-highlight);
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.tele-btn:hover {
    background: #2a2a57;
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.tele-icon {
    width: 20px;
    height: 20px;
}

/* ── Navigation Tabs ── */
.nav-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.tab-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #ffffff;
    background: #1a1a36;
    border-color: var(--border-highlight);
}

.tab-btn.active {
    color: #000000;
    background: var(--primary);
    border-color: var(--primary);
    font-weight: 700;
    box-shadow: 0 0 16px var(--primary-glow);
}

.badge-count {
    background: #ff4d4d;
    color: #ffffff;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
}

.tab-pane {
    display: none;
    flex-direction: column;
    gap: 16px;
}

.tab-pane.active {
    display: flex;
}

/* ── Card Box Styles ── */
.card-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.box-header {
    background: var(--bg-card-header);
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.box-title {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.window-dots {
    display: flex;
    gap: 5px;
}

.dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}
.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }

.font-mono {
    font-family: var(--font-mono);
}

/* ── Generator Box ── */
.gen-grid {
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 80px;
}

.form-group.flex-2 {
    flex: 2;
    min-width: 140px;
}

.form-group.flex-btn {
    flex: 0 0 auto;
}

.form-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="text"],
input[type="number"],
select,
textarea {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    outline: none;
    transition: all 0.2s;
    width: 100%;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* ── Buttons ── */
button {
    font-family: var(--font-sans);
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #00cc66, #00ff88);
    color: #000000;
    font-weight: 700;
    padding: 9px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #00dd77, #33ffaa);
    box-shadow: 0 0 14px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #1e1e3f;
    color: #ffffff;
    border: 1px solid var(--border-highlight);
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.btn-secondary:hover {
    background: #2a2a57;
    border-color: var(--primary);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 11px;
    border-radius: 4px;
    font-weight: 600;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: var(--border-highlight);
}

.btn-danger {
    background: rgba(255, 77, 77, 0.15);
    color: #ff6666;
    border: 1px solid rgba(255, 77, 77, 0.3);
}

.btn-danger:hover {
    background: rgba(255, 77, 77, 0.3);
    color: #ff9999;
}

/* ── Input Box ── */
.input-box textarea {
    height: 150px;
    resize: vertical;
    border: none;
    border-radius: 0;
    padding: 12px 16px;
    color: var(--primary);
    background: transparent;
    line-height: 1.5;
}

.card-counter {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}

/* ── Action Bar ── */
.action-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-action {
    height: 42px;
    padding: 0 24px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-start {
    background: linear-gradient(135deg, #00cc66, #00ff88);
    color: #000000;
}

.btn-start:hover:not(:disabled) {
    box-shadow: 0 0 16px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-stop {
    background: linear-gradient(135deg, #cc2929, #ff4d4d);
    color: #ffffff;
}

.btn-stop:hover:not(:disabled) {
    box-shadow: 0 0 16px rgba(255, 77, 77, 0.4);
}

.btn-clear {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.btn-clear:hover {
    background: #1a1a36;
    color: #ffffff;
}

.btn-action:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.progress-wrap {
    flex: 1;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.progress-bar-bg {
    height: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00cc66, #00ff88);
    border-radius: 10px;
    transition: width 0.2s ease;
}

/* ── Stats Grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.stat-num {
    font-size: 24px;
    font-weight: 800;
    font-family: var(--font-mono);
    margin-bottom: 2px;
}

.stat-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
}

.stat-live {
    border-top: 3px solid var(--live-color);
    border-color: var(--live-border);
}
.stat-live .stat-num, .stat-live .stat-label { color: var(--live-color); }

.stat-die {
    border-top: 3px solid var(--die-color);
    border-color: var(--die-border);
}
.stat-die .stat-num, .stat-die .stat-label { color: var(--die-color); }

.stat-unknown {
    border-top: 3px solid var(--unk-color);
    border-color: var(--unk-border);
}
.stat-unknown .stat-num, .stat-unknown .stat-label { color: var(--unk-color); }

.stat-total {
    border-top: 3px solid #8888aa;
}
.stat-total .stat-num, .stat-total .stat-label { color: #aaaacc; }

/* ── Results Container ── */
.flex-wrap {
    flex-wrap: wrap;
    gap: 10px;
}

.filter-group {
    display: flex;
    gap: 6px;
}

.filter-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.filter-pill.active {
    background: var(--border-highlight);
    color: #ffffff;
}

.filter-pill.filter-live.active {
    background: var(--live-bg);
    color: var(--live-color);
    border-color: var(--live-color);
}

.filter-pill.filter-die.active {
    background: var(--die-bg);
    color: var(--die-color);
    border-color: var(--die-color);
}

.filter-pill.filter-unknown.active {
    background: var(--unk-bg);
    color: var(--unk-color);
    border-color: var(--unk-color);
}

.export-group {
    display: flex;
    gap: 6px;
}

.results-container {
    padding: 10px;
    min-height: 280px;
    max-height: 480px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 12px;
    gap: 10px;
    animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.row-live {
    background: var(--live-bg);
    border: 1px solid var(--live-border);
    border-left: 3px solid var(--live-color);
}

.row-die {
    background: var(--die-bg);
    border: 1px solid var(--die-border);
    border-left: 3px solid var(--die-color);
}

.row-unknown {
    background: var(--unk-bg);
    border: 1px solid var(--unk-border);
    border-left: 3px solid var(--unk-color);
}

.res-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.status-badge {
    font-weight: 800;
    font-size: 11px;
    min-width: 60px;
    letter-spacing: 0.5px;
}

.status-badge.live { color: var(--live-color); }
.status-badge.die { color: var(--die-color); }
.status-badge.unknown { color: var(--unk-color); }

.card-val {
    color: #e2e8f0;
    cursor: pointer;
    transition: color 0.15s;
}

.card-val:hover {
    color: #ffffff;
    text-decoration: underline;
}

.res-right {
    color: var(--text-muted);
    font-size: 11px;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empty-state {
    padding: 48px 20px;
    text-align: center;
    color: var(--text-dim);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.empty-icon {
    font-size: 32px;
}

/* ── Workspace ── */
.workspace-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    min-height: 480px;
}

@media (max-width: 860px) {
    .workspace-grid {
        grid-template-columns: 1fr;
    }
}

.ws-col {
    display: flex;
    flex-direction: column;
}

.btn-group-sm {
    display: flex;
    gap: 6px;
}

.saved-cards-list {
    flex: 1;
    padding: 12px;
    max-height: 440px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.saved-card-row {
    background: #0d0d1a;
    border: 1px solid rgba(0, 255, 136, 0.25);
    border-left: 3px solid var(--primary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
}

.saved-parts {
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-part-btn {
    background: transparent;
    color: var(--primary);
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 3px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.card-part-btn:hover {
    background: #1e1e3f;
    color: #ffffff;
    text-decoration: underline;
}

.part-sep {
    color: var(--text-dim);
    font-size: 11px;
}

.notes-textarea {
    flex: 1;
    min-height: 380px;
    background: transparent;
    border: none;
    padding: 16px;
    color: #ffffff;
    line-height: 1.6;
    resize: vertical;
}

.notes-footer {
    padding: 8px 16px;
    background: var(--bg-card-header);
    border-top: 1px solid var(--border-color);
    font-size: 11px;
}

.auto-save-tag {
    color: var(--primary);
    font-weight: 600;
}

/* ── BIN Lookup Panel ── */
.lookup-box {
    padding: 20px;
}

.badge-source {
    font-size: 10px;
    background: #2a2a57;
    color: #a0a0ff;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
}

.lookup-input-row {
    display: flex;
    gap: 10px;
    margin: 16px 0;
}

.lookup-input-row input {
    font-size: 15px;
    padding: 12px 16px;
}

.bin-result-panel {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    min-height: 240px;
    font-family: var(--font-mono);
}

.bin-data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.bin-item-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}

.bin-item-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
}

.bin-item-val {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
}

.scheme-visa { color: #1a73e8; }
.scheme-mastercard { color: #eb001b; }
.scheme-amex { color: #016fd0; }
.scheme-discover { color: #f76f20; }

/* ── Address Generator ── */
.addr-box {
    padding: 20px;
}

.addr-control-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin: 16px 0;
    flex-wrap: wrap;
}

.addr-display-panel {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    min-height: 240px;
    font-family: var(--font-mono);
    line-height: 1.8;
}

/* ── Toast Notifications ── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: #181830;
    color: #ffffff;
    border: 1px solid var(--border-highlight);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideUp 0.2s ease-out;
}

.toast.toast-success {
    border-left: 4px solid var(--primary);
}

.toast.toast-error {
    border-left: 4px solid var(--die-color);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Footer ── */
.app-footer {
    margin-top: auto;
    padding-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-dim);
    font-size: 12px;
    border-top: 1px solid var(--border-color);
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-links a {
    color: var(--primary);
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

@media (max-width: 680px) {
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    .app-footer {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}
