/* ==================== RESET & BASE ==================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f172a;
    overflow: hidden;
    height: 100vh;
    color: #e2e8f0;
}

/* ==================== STATUS BAR (top, 40px) ==================== */
.status-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 600;
    z-index: 10000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.status-bar.online   { background: #10b981; color: white; }
.status-bar.on_break { background: #f59e0b; color: white; }
.status-bar.offline  { background: #6b7280; color: white; }

.status-left  { display: flex; align-items: center; gap: 8px; }
.status-right { display: flex; align-items: center; }

.session-counter {
    font-size: 13px;
    padding: 4px 12px;
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
    font-weight: 600;
}

/* ==================== TAB NAVIGATION (below status bar, 50px) ==================== */
.tab-nav {
    position: fixed;
    top: 40px; left: 0; right: 0;
    height: 50px;
    background: #0f172a;
    border-bottom: 2px solid #1e293b;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 4px;
    z-index: 998;
    overflow-x: auto;
    scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
    padding: 8px 20px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tab-btn:hover  { background: #1e293b; color: #e2e8f0; }
.tab-btn.active { background: #3b82f6; color: white; }
.tab-btn:active { transform: scale(0.97); }

/* ==================== PIN BANNER (below tabs) ==================== */
/* top = 40px status + 50px tabs = 90px */
.pin-banner {
    position: fixed;
    top: 90px; left: 0; right: 0;
    z-index: 150;
    background: #1e293b;
    border-bottom: 3px solid #3b82f6;
    padding: 10px 16px;
    animation: slideDown 0.2s ease;
}
.pin-banner.blacklisted { background: #7f1d1d; border-color: #dc2626; }
.pin-banner.punyeta     { background: #dc2626; border-color: #fecaca;
                          animation: slideDown 0.2s ease, punyeta-strobe .55s ease-in-out infinite; }
.pin-banner.joy-miner   { background: #78350f; border-color: #f59e0b; }
.pin-banner.new         { background: #1e3a8a; border-color: #3b82f6; }
.pin-banner.returning   { background: #064e3b; border-color: #10b981; }
@media (prefers-reduced-motion: reduce) {
    .pin-banner.punyeta { animation: slideDown 0.2s ease; background: #b91c1c; }
}

.pin-banner-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.pin-banner-left { display: flex; align-items: center; gap: 10px; }
.pin-nickname { font-size: 15px; font-weight: 700; color: #f1f5f9; }
.pin-username { font-size: 12px; color: #94a3b8; }
.pin-lock-line {
    font-size: 11px; color: #fde68a;
    margin-top: 2px; font-weight: 600; letter-spacing: 0.02em;
}

.pin-badge {
    font-size: 12px; font-weight: 700;
    padding: 4px 12px; border-radius: 20px; white-space: nowrap;
}
.pin-badge.blacklisted { background: #dc2626; color: white; }
.pin-badge.punyeta     { background: #fff; color: #b91c1c; font-weight: 800; }
.pin-badge.joy-miner   { background: #f59e0b; color: #1c1917; }
.pin-badge.new         { background: #3b82f6; color: white; }
.pin-badge.returning   { background: #10b981; color: white; }

.pin-dismiss-btn {
    background: rgba(255,255,255,0.15);
    border: none; color: white;
    font-size: 18px; line-height: 1;
    width: 28px; height: 28px;
    border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: background 0.15s;
}
.pin-dismiss-btn:hover { background: rgba(255,255,255,0.3); }

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to   { transform: translateY(0); }
}

/* ==================== WARNING HEADER ==================== */
.warning-header {
    position: fixed;
    left: 0; right: 0;
    top: var(--warning-top, 90px);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    z-index: 140;
    border-bottom: 2px solid;
    transition: top 0.2s ease, all 0.3s;
}
.warning-header.error   { background: #7f1d1d; border-color: #dc2626; color: #fecaca; }
.warning-header.warning { background: #78350f; border-color: #f59e0b; color: #fde68a; }
.warning-header.info    { background: #1e3a8a; border-color: #3b82f6; color: #bfdbfe; }

/* Punyeta (RTS) — alarm-grade, deliberately louder than the blacklist bar.
   Strobing red + siren glow + entry shake + oversized pulsing icon. */
.warning-header.punyeta {
    background: #dc2626;
    border-color: #fecaca;
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    text-shadow: 0 1px 3px rgba(0,0,0,.55);
    border-bottom-width: 3px;
    transition: none;   /* let the keyframes drive color/transform, no smoothing */
    animation: punyeta-strobe .55s ease-in-out infinite,
               punyeta-shake  .5s  ease-in-out 3;
}
.warning-header.punyeta #warningIcon {
    font-size: 26px;
    animation: punyeta-icon .55s ease-in-out infinite;
}
@keyframes punyeta-strobe {
    0%, 100% { background: #7f1d1d; box-shadow: 0 2px 8px rgba(220,38,38,.3); }
    50%      { background: #ef4444;
               box-shadow: 0 4px 34px rgba(239,68,68,.95), 0 0 70px rgba(239,68,68,.55); }
}
@keyframes punyeta-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-7px); }
    40% { transform: translateX(7px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}
@keyframes punyeta-icon {
    0%, 100% { transform: scale(1)    rotate(-8deg); }
    50%      { transform: scale(1.28) rotate(8deg); }
}
@media (prefers-reduced-motion: reduce) {
    .warning-header.punyeta,
    .warning-header.punyeta #warningIcon { animation: none; }
    .warning-header.punyeta { background: #b91c1c; }
}

#warningIcon { font-size: 20px; }
#warningText { flex: 1; }

/* ==================== TAB CONTENT ==================== */
.tab-content { display: none; }
.tab-content.active { display: grid; }

/* ==================== PRINT TAB LAYOUT ==================== */
/* top = status(40) + tabs(50) = 90px, plus variable banners via --layout-top */
#tab-print {
    position: fixed;
    top: var(--layout-top, 90px);
    left: 0; right: 0; bottom: 0;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 0;
    transition: top 0.2s ease;
}

/* ==================== LEFT: MINE BOARD ==================== */
.mine-board-zone {
    background: #1e293b;
    overflow-y: auto;
    padding: 16px;
    border-right: 2px solid #334155;
}

.zone-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #334155;
}
.zone-header h2 {
    font-size: 18px;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-input {
    padding: 8px 14px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 14px;
    width: 200px;
}
.search-input:focus { outline: none; border-color: #3b82f6; }

.mine-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    color: #64748b;
    padding: 60px 20px;
    font-size: 15px;
}

/* Mine Cards */
.miner-card {
    background: #0f172a;
    border: 2px solid #334155;
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;   /* anchor the ⋯ actions button */
}
/* "⋯" actions button — opens Re-Live / Blacklist menu (reliable on touch) */
.miner-menu-btn {
    position: absolute; top: 4px; right: 6px;
    width: 30px; height: 26px; line-height: 22px;
    padding: 0; border: none; border-radius: 7px;
    background: transparent; color: #94a3b8;
    font-size: 20px; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    z-index: 2;
}
.miner-menu-btn:hover, .miner-menu-btn:active { background: #334155; color: #e2e8f0; }
.miner-card:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59,130,246,0.2);
}
.miner-card:active { transform: translateY(0); }

.miner-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    padding-right: 30px;   /* clear the ⋯ actions button in the corner */
}
.miner-nickname {
    font-size: 15px; font-weight: 600; color: #e2e8f0; margin-bottom: 2px;
}
.miner-username { font-size: 14px; font-weight: 500; color: #e2e8f0; }
.miner-username.secondary { font-size: 12px; font-weight: 400; color: #94a3b8; }
.approved-badge { color: #10b981; font-size: 16px; }

/* Buyer status pills on each mine card (mirrors the PC mine board) */
.miner-pill {
    display: inline-flex; align-items: center;
    font-size: 9px; font-weight: 700; letter-spacing: .02em;
    padding: 1px 6px; border-radius: 5px; flex-shrink: 0; white-space: nowrap;
}
.miner-pill.joy { background: #f59e0b; color: #1c1917; }   /* bright amber */
.miner-pill.new { background: #3b82f6; color: #ffffff; }   /* bright blue  */
.miner-pill.old { background: #10b981; color: #04231a; }   /* bright green */
.carry-tag { font-size: 10px; color: #94a3b8; margin-left: 5px; font-weight: 400; }

/* One-time first-visit intro (3 steps) */
#sellerIntro {
    display:none; position:fixed; inset:0; z-index:5000;
    background:rgba(2,6,23,.82); align-items:center; justify-content:center; padding:24px;
}
#sellerIntro.open { display:flex; }
.si-card {
    background:#1e293b; border:1px solid #334155; border-radius:16px;
    max-width:360px; width:100%; padding:24px 22px; text-align:center;
}
.si-emoji { font-size:38px; margin-bottom:10px; }
.si-title { font-size:17px; font-weight:800; color:#f1f5f9; margin-bottom:8px; }
.si-body  { font-size:13px; color:#94a3b8; line-height:1.6; margin-bottom:18px; }
.si-dots  { display:flex; gap:6px; justify-content:center; margin-bottom:16px; }
.si-dot   { width:8px; height:8px; border-radius:50%; background:#334155; }
.si-dot.on{ background:#10b981; }
.si-next  {
    width:100%; padding:12px; border:none; border-radius:10px; cursor:pointer;
    background:#10b981; color:#04231a; font-size:14px; font-weight:800;
}
.si-skip  { background:none; border:none; color:#64748b; font-size:12px; margin-top:10px; cursor:pointer; }

/* Long-press / right-click menu on a mine card (Re-Live / Blacklist) — #9 */
.mine-card-menu {
    position: fixed; z-index: 3000; display: none;
    background: #1e293b; border: 1px solid #334155; border-radius: 10px;
    padding: 6px; min-width: 210px; box-shadow: 0 10px 34px rgba(0,0,0,.55);
}
.mine-card-menu .mcm-title {
    font-size: 11px; color: #94a3b8; padding: 4px 8px 7px;
    border-bottom: 1px solid #334155; margin-bottom: 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mine-card-menu .mcm-item {
    padding: 11px 10px; font-size: 14px; border-radius: 6px;
    cursor: pointer; color: #e2e8f0; user-select: none;
}
.mine-card-menu .mcm-item:hover, .mine-card-menu .mcm-item:active { background: #334155; }
.mine-card-menu .mcm-item.danger { color: #f87171; }

/* New-miner over-limit highlight (mirrors the PC app's nm-over).
   Bright red border + inset ring + soft glow so it's unmistakable on a busy dark board
   (the old dark-red-on-dark was too subtle to notice). */
.miner-card.nm-over {
    border-color: #ef4444;
    background: #2a0e0e;
    box-shadow: 0 0 0 1px #ef4444 inset, 0 2px 10px rgba(239,68,68,0.28);
}
.nm-limit-tag {
    display: inline-flex; align-items: center;
    font-size: 9px; font-weight: 700; flex-shrink: 0; white-space: nowrap;
    padding: 1px 6px; border-radius: 5px;
    background: #3a1414; color: #e07070; border: 0.5px solid #6a2020;
}

.miner-tiers { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }

.tier-pill {
    display: flex;
    align-items: center;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    font-size: 13px; font-weight: 500;
    overflow: hidden;
    transition: all 0.15s;
}
.tier-pill:hover { background: #334155; border-color: #475569; }
.tier-pill.free   { border-color: #7c3aed; }
.tier-pill.bundle { border-color: #0891b2; background: #0c1a2e; }

.tier-content {
    padding: 5px 8px;
    cursor: pointer;
    user-select: none;
    flex: 1;
}

.void-btn {
    background: transparent;
    border: none;
    border-left: 1px solid #334155;
    color: #64748b;
    padding: 5px 7px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    transition: all 0.15s;
}
.void-btn:hover { background: #dc2626; color: white; border-color: #dc2626; }

/* Order status pills */
.order-pill {
    font-size: 10px; font-weight: 700;
    padding: 2px 7px; border-radius: 10px; white-space: nowrap;
}
.pill-ready    { background: #065f46; color: #6ee7b7; border: 1px solid #10b981; }
.pill-approved { background: #1e3a8a; color: #93c5fd; border: 1px solid #3b82f6; }
.pill-mismatch { background: #78350f; color: #fde68a; border: 1px solid #f59e0b; }
.pill-pending  { background: #1e293b; color: #94a3b8; border: 1px solid #475569; }

/* ==================== RIGHT: PRINT FORM (380px) ==================== */
.print-form-zone {
    background: #0f172a;
    border-left: 2px solid #1e293b;
    padding: 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.input-group label {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group input {
    padding: 8px 10px;
    border: 2px solid #334155;
    border-radius: 6px;
    font-size: 14px;
    background: #1e293b;
    color: #f1f5f9;
    transition: border-color 0.2s;
    width: 100%;
}
.input-group input:focus { outline: none; border-color: #3b82f6; background: #0f172a; }

/* Price */
.price-section label {
    display: block;
    font-size: 11px; font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.price-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.price-btn {
    padding: 8px 4px;
    border: 2px solid #334155;
    border-radius: 6px;
    background: #1e293b;
    font-size: 13px; font-weight: 600;
    color: #f1f5f9;
    cursor: pointer;
    transition: all 0.12s;
    text-align: center;
}
.price-btn:hover    { border-color: #3b82f6; background: #334155; }
.price-btn.selected { border-color: #10b981; background: #10b981; color: white; }
.price-btn.free     { background: #fef3c7; border-color: #fbbf24; color: #92400e; }
.price-btn.free.selected { background: #f59e0b; border-color: #d97706; color: white; }

/* Qty */
.qty-section {
    display: flex;
    align-items: center;
    gap: 12px;
}
.qty-section label {
    font-size: 11px; font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase; letter-spacing: 0.5px;
    white-space: nowrap;
}

.qty-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}
.qty-selector button {
    width: 36px; height: 36px;
    border: 2px solid #334155;
    border-radius: 6px;
    background: #1e293b;
    font-size: 18px; font-weight: 700;
    color: #f1f5f9;
    cursor: pointer;
    transition: all 0.12s;
}
.qty-selector button:hover  { border-color: #3b82f6; background: #334155; }
.qty-selector button:active { transform: scale(0.92); }

#qtyDisplay {
    font-size: 22px; font-weight: 700;
    color: #10b981;
    min-width: 36px; text-align: center;
}

/* Action buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn {
    padding: 11px;
    border: none;
    border-radius: 8px;
    font-size: 13px; font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn:active  { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary  { background: #10b981; color: white; }
.btn-primary:hover:not(:disabled) { background: #059669; }

.btn-secondary { background: #334155; color: #f1f5f9; }
.btn-secondary:hover:not(:disabled) { background: #475569; }

/* Request status */
.request-status {
    background: #fef3c7;
    border: 2px solid #fbbf24;
    border-radius: 8px;
    padding: 10px 12px;
    text-align: center;
}
#statusMessage { font-size: 13px; font-weight: 600; color: #92400e; margin-bottom: 4px; }
#countdown     { font-size: 12px; color: #92400e; }

/* Printer card */
.printer-card {
    background: #1e293b;
    border: 2px solid #334155;
    border-radius: 8px;
    padding: 12px;
    margin-top: auto;
}
.printer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px; font-weight: 600; color: #94a3b8;
}
.printer-status-text { font-size: 12px; }
.printer-btns { display: flex; gap: 8px; }

.btn-printer {
    flex: 1;
    background: #334155;
    border: 1px solid #475569;
    color: #f1f5f9;
}
.btn-printer:hover:not(:disabled) { background: #3b82f6; border-color: #3b82f6; color: white; }

.btn-icon {
    background: #1e293b;
    border: 1px solid #334155;
    color: #64748b;
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s;
}
.btn-icon:hover { background: #7f1d1d; border-color: #dc2626; color: #fecaca; }

.printer-hint {
    font-size: 11px; color: #10b981;
    text-align: center; margin-top: 6px;
}

/* ==================== OTHERS TAB ==================== */
.tab-panel {
    position: fixed;
    top: var(--layout-top, 90px);
    left: 0; right: 0; bottom: 0;
    flex-direction: column;
    overflow: hidden;
    background: #0f172a;
    display: none;
    transition: top 0.2s ease;
}

/* 3-column body — flex so JS can set pixel widths via flex-basis */
.others-body {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0;
}

/* Each column */
.others-col {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 180px;
    flex-shrink: 0;
}

/* Default widths — JS overrides on drag */
#col-buyers  { flex-basis: 280px; }
#col-keep    { flex-basis: 280px; }
#col-history { flex: 1; min-width: 240px; } /* history takes remaining space */

/* Sticky column header */
.col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    background: #1e293b;
    border-bottom: 2px solid #334155;
    border-right: 1px solid #334155;
    flex-shrink: 0;
    height: 46px;
}
.col-title {
    font-size: 14px; font-weight: 700; color: #f1f5f9;
    white-space: nowrap;
}
.col-search {
    width: 120px; min-width: 0; flex-shrink: 1;
    font-size: 12px; padding: 5px 8px;
}

/* Scrollable column body */
.col-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    border-right: 1px solid #334155;
}
#col-history .col-header,
#col-history .col-body { border-right: none; }

/* ── Resize handles ── */
.col-resize-handle {
    width: 5px;
    background: #334155;
    cursor: col-resize;
    flex-shrink: 0;
    position: relative;
    transition: background 0.15s;
    z-index: 10;
}
.col-resize-handle:hover,
.col-resize-handle.dragging { background: #3b82f6; }

/* Drag overlay — prevents iframe/text selection eating mouse events */
.resize-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    cursor: col-resize;
}

/* ==================== BUYERS (in col) ==================== */
.add-toggle-btn { font-size: 13px; margin-bottom: 12px; }

.add-form {
    flex-direction: column; gap: 8px;
    padding: 10px 0 12px;
    border-bottom: 1px solid #334155;
    margin-bottom: 12px;
}
.add-form-row { display: flex; gap: 6px; align-items: center; }

.add-form-row input {
    flex: 1; min-width: 0;
    padding: 8px 10px;
    border: 2px solid #334155;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    background: #1e293b;
    color: #f1f5f9;
    transition: border-color 0.2s;
}
.add-form-row input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #0f172a;
}

.add-form-row select {
    padding: 8px 8px;
    border: 2px solid #334155;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    background: #1e293b;
    color: #f1f5f9;
    transition: border-color 0.2s;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}
.add-form-row select:focus {
    outline: none;
    border-color: #3b82f6;
    background-color: #0f172a;
}

.buyers-section { margin-bottom: 16px; }
.buyers-section-header {
    font-size: 11px; font-weight: 700;
    color: #64748b;
    text-transform: uppercase; letter-spacing: 0.08em;
    padding: 8px 0 6px;
    border-bottom: 1px solid #1e293b;
    margin-bottom: 6px;
    display: flex; align-items: center; gap: 6px;
}
.section-count {
    font-size: 11px; background: #1e293b; color: #64748b;
    padding: 1px 6px; border-radius: 8px;
}

.buyer-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #1e293b;
}
.buyer-info { display: flex; flex-direction: column; gap: 2px; }
.buyer-username { font-size: 13px; color: #e2e8f0; font-weight: 500; }
.buyer-reason   { font-size: 11px; color: #64748b; }
.buyers-empty   { font-size: 12px; color: #475569; padding: 6px 0; }

.buyer-remove-btn {
    background: transparent;
    border: 1px solid #334155; color: #64748b;
    width: 26px; height: 26px; border-radius: 50%;
    cursor: pointer; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: all 0.15s;
}
.buyer-remove-btn:hover { background: #7f1d1d; border-color: #dc2626; color: white; }

/* ==================== KEEP ITEMS (in col) ==================== */
.keep-list-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.keep-card {
    background: #1e293b;
    border: 2px solid #334155;
    border-radius: 8px;
    padding: 12px;
}
.keep-card.keep-unpaid { border-color: #f59e0b; }
.keep-card.keep-paid   { border-color: #334155; opacity: 0.85; }

.keep-card-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 6px;
}
.keep-nickname { font-size: 14px; font-weight: 600; color: #e2e8f0; }
.keep-username { font-size: 11px; color: #94a3b8; }
.keep-items-line { font-size: 12px; color: #94a3b8; margin-bottom: 4px; }
.keep-date { font-size: 11px; color: #475569; margin-bottom: 8px; }

.keep-status-badge {
    font-size: 11px; font-weight: 700;
    padding: 2px 8px; border-radius: 10px; white-space: nowrap;
}
.keep-status-badge.keep-unpaid { background: #78350f; color: #fde68a; }
.keep-status-badge.keep-paid   { background: #064e3b; color: #6ee7b7; }

.keep-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.keep-btn { font-size: 12px; padding: 6px 10px; }

/* ==================== SESSION HISTORY (in col) ==================== */
.history-list-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    overflow: hidden;
}
.history-card-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
}
.history-card-header:hover { background: #263347; }
.history-date { font-size: 13px; font-weight: 600; color: #e2e8f0; }
.history-dur  { font-size: 11px; color: #64748b; margin-top: 2px; }
.history-expand-icon { font-size: 18px; color: #64748b; }

.history-card-body {
    border-top: 1px solid #334155;
}

.hist-summary-bar {
    display: flex; gap: 12px; align-items: center;
    padding: 8px 14px;
    flex-wrap: wrap;
    border-bottom: 1px solid #1e293b;
    background: #0f172a;
}
.hist-revenue     { font-size: 15px; font-weight: 700; color: #10b981; }
.hist-miner-count { font-size: 12px; color: #94a3b8; }
.hist-breakdown   { font-size: 11px; color: #64748b; }

/* History rows — match screenshot: name | tiers | total */
.hist-miner-row {
    display: flex;
    align-items: center;
    padding: 7px 14px;
    border-bottom: 1px solid #1e293b;
    gap: 12px;
}
.hist-miner-row:last-child { border-bottom: none; }

.hist-miner-name {
    min-width: 140px;
    flex-shrink: 0;
}
.hist-nickname        { font-size: 14px; font-weight: 600; color: #e2e8f0; display: block; }
.hist-username        { font-size: 12px; color: #64748b; display: block; }
.hist-username.primary{ font-size: 14px; font-weight: 500; color: #e2e8f0; }

.hist-tiers {
    display: flex; gap: 4px; flex-wrap: wrap; flex: 1;
}
.hist-tier {
    font-size: 11px; background: #0f172a;
    border: 1px solid #334155; border-radius: 4px;
    padding: 2px 7px; color: #94a3b8;
    white-space: nowrap;
}

.hist-total {
    font-size: 13px; font-weight: 700; color: #10b981;
    white-space: nowrap; margin-left: auto;
}

/* ==================== PANEL HEADER (keep for overlays) ==================== */
.panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 2px solid #334155;
    background: #0f172a;
    gap: 12px; flex-shrink: 0;
    position: sticky; top: 0; z-index: 10;
}
.panel-header h2 { font-size: 18px; color: #f1f5f9; }
.panel-count {
    font-size: 12px; background: #334155; color: #94a3b8;
    padding: 2px 8px; border-radius: 10px;
}

/* ==================== SESSION END OVERLAY ==================== */
.session-end-overlay {
    position: fixed; inset: 0;
    background: rgba(15,23,42,0.92);
    display: flex; align-items: center; justify-content: center;
    z-index: 9000;
}
.session-end-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 16px;
    padding: 36px 28px;
    max-width: 360px; width: 90%;
    text-align: center;
}
.session-end-icon { font-size: 48px; margin-bottom: 12px; }
.session-end-card h2 { font-size: 22px; color: #f1f5f9; margin-bottom: 24px; }
.session-end-stats {
    display: flex; justify-content: center; gap: 28px; margin-bottom: 24px;
}
.ses-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ses-stat-value { font-size: 24px; font-weight: 700; color: #10b981; }
.ses-stat-label { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: 0.08em; }
.session-end-btns { display: flex; gap: 10px; }
.session-end-btns .btn { flex: 1; }

/* ==================== NO SESSION OVERLAY ==================== */
.no-session-overlay {
    position: fixed; inset: 0;
    background: rgba(15,23,42,0.96);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
}
.no-session-content {
    text-align: center; padding: 40px 24px; max-width: 340px;
}
.no-session-content h3 { font-size: 22px; color: #f1f5f9; margin-bottom: 12px; }
.no-session-content p  { font-size: 14px; color: #94a3b8; line-height: 1.6; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    #tab-print {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
    }
    .mine-board-zone { border-right: none; border-bottom: 2px solid #334155; }
    .print-form-zone { border-left: none; border-top: 2px solid #1e293b; max-height: 45vh; }
}

@media (max-width: 768px) {
    .mine-board { grid-template-columns: 1fr; }
    .price-grid { grid-template-columns: repeat(3, 1fr); }
    .tab-btn { padding: 8px 12px; font-size: 12px; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
.pulse { animation: pulse 1.5s ease-in-out infinite; }

/* Old miner hide button — grey, not red, since it's not a permanent delete */
.buyer-hide-btn { border-color: #475569; color: #475569; }
.buyer-hide-btn:hover { background: #334155; border-color: #64748b; color: #e2e8f0; }

/* ==================== LOGOUT BUTTON ==================== */
.logout-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.7);
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 13px;
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.15s;
    line-height: 1.4;
}
.logout-btn:hover {
    background: rgba(255,255,255,0.15);
    color: white;
    border-color: rgba(255,255,255,0.4);
}

/* ==================== PIN QUEUE BADGE ==================== */
.pin-queue-badge {
    font-size: 11px; font-weight: 700;
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

/* ==================== UNDO TOAST ==================== */
.undo-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 5000;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    min-width: 280px;
    max-width: 420px;
    flex-direction: column;
}
.undo-toast > div:first-child {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}
#undoToastMsg {
    font-size: 13px;
    color: #e2e8f0;
    flex: 1;
}
.undo-toast-btn {
    background: #3b82f6;
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    font-family: inherit;
}
.undo-toast-btn:hover { background: #2563eb; }

.undo-progress {
    width: 100%;
    height: 3px;
    background: #3b82f6;
    border-radius: 2px;
    transform-origin: left;
}

/* ==================== PIN BANNER SKIP / CLEAR BUTTONS ==================== */
.pin-skip-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    font-size: 12px; font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    font-family: inherit;
}
.pin-skip-btn:hover { background: rgba(255,255,255,0.25); }

.pin-clear-btn {
    background: rgba(220,38,38,0.3);
    border: 1px solid rgba(220,38,38,0.5);
    color: #fecaca;
    font-size: 12px; font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    font-family: inherit;
}
.pin-clear-btn:hover { background: rgba(220,38,38,0.5); }
