@import url('https://fonts.googleapis.com/css2?family=Bungee&display=swap');

.hidden { display: none !important; }

.po-neo-wrapper {
    font-family: system-ui, -apple-system, sans-serif;
    max-width: 850px; margin: 30px auto; background: #fff;
    border: 3px solid #000; border-radius: 16px; box-shadow: 10px 10px 0px #000;
    padding: 25px; box-sizing: border-box; color: #000;
}
.po-neo-wrapper * { box-sizing: border-box; }

.po-header {
    background: #e2f0cb; padding: 20px; border-radius: 12px;
    border: 3px solid #000; box-shadow: 4px 4px 0px #000; margin-bottom: 25px; text-align: center;
}
.po-header h2 { margin: 0 0 10px 0; font-size: 1.8rem; font-weight: 900; text-transform: uppercase; color: #111;}
.po-header p { margin: 0; font-weight: 700; font-size: 1rem; color: #333; }

/* TABS */
.po-tabs { display: flex; gap: 10px; margin-bottom: 20px;}
.po-tab {
    flex: 1; padding: 12px; font-size: 1.1rem; font-weight: 900; text-transform: uppercase;
    background: #f4f4f4; border: 3px solid #000; border-radius: 8px;
    box-shadow: 4px 4px 0px #000; cursor: pointer; transition: 0.1s; text-align: center;
}
.po-tab:active { transform: translate(2px, 2px); box-shadow: 0px 0px 0px #000; }
.po-tab.active { background: #ffb3c6; color: #000; }

/* BỐ CỤC CARD & GRID */
.po-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; }
.po-card { border: 3px solid #000; padding: 20px; border-radius: 12px; box-shadow: 4px 4px 0px #000;}
.card-title { margin: 0 0 15px 0; font-size: 1.2rem; font-weight: 900; text-transform: uppercase; border-bottom: 2px dashed #000; padding-bottom: 10px;}

.bg-yellow { background: #fdfd96; }
.bg-pink { background: #ffb3c6; }
.bg-blue { background: #c6e2ff; }
.bg-green { background: #baffc9; }

/* MASTER RULE: NHÃN ĐEN TUYỀN ĐẬM */
.po-neo-wrapper label { display: block; color: #000 !important; font-weight: 900; font-size: 1rem; margin-bottom: 8px; text-transform: uppercase;}

/* INPUT STYLES */
.po-group { margin-bottom: 0; }
.po-input-wrap { position: relative; }
.po-input {
    width: 100%; padding: 15px 60px 15px 15px; font-size: 1.4rem; font-weight: 900; font-family: 'Courier New', monospace;
    border: 3px dashed #000; border-radius: 8px; outline: none; background: #fff; transition: 0.1s;
}
.po-input:focus { border-style: solid; border-color: #1982c4; box-shadow: 4px 4px 0px #1982c4; transform: translateY(-2px); }

.po-suffix {
    position: absolute; right: 15px; top: 50%; transform: translateY(-50%);
    font-weight: 900; font-size: 1.2rem; color: #555; pointer-events: none;
}

.po-live-text { color: #1982c4; font-weight: 800; font-size: 0.85rem; margin-top: 6px; min-height: 16px; font-style: italic;}

/* HÀNG NHẬP LIỆU ĐỘNG (NHIỀU SẢN PHẨM) */
.po-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 15px;}
.po-row { display: flex; gap: 10px; align-items: flex-start; background: #fff; padding: 15px 10px; border: 2px solid #000; border-radius: 8px;}
.po-col-price { flex: 2; }
.po-col-discount { flex: 1; }

.po-input-small {
    width: 100%; padding: 10px; font-size: 1.1rem; font-weight: 900; font-family: 'Courier New', monospace;
    border: 2px solid #000; border-radius: 6px; outline: none; background: #f4f4f4; transition: 0.1s;
}
.po-input-small:focus { background: #fff; border-color: #1982c4; box-shadow: 2px 2px 0px #1982c4;}

.btn-remove { background: #ffadad; border: 2px solid #000; border-radius: 6px; cursor: pointer; padding: 10px; font-size: 1rem; align-self: flex-start; margin-top: 27px; box-shadow: 2px 2px 0px #000;}
.btn-remove:active { transform: translate(2px, 2px); box-shadow: 0px 0px 0px #000; }

.po-btn-add { width: 100%; padding: 12px; font-size: 1rem; font-weight: 900; background: #fff; color: #000; border: 2px dashed #000; border-radius: 8px; cursor: pointer; transition: 0.1s;}
.po-btn-add:hover { background: #111; color: #fff;}

/* BÁO LỖI REALTIME */
.po-error-box {
    margin-top: 20px; background: #ffadad; color: #900000; border: 3px solid #000;
    padding: 15px; border-radius: 8px; font-weight: 900; font-size: 1.1rem;
    box-shadow: 4px 4px 0px #000; text-align: center; animation: shake 0.4s ease-in-out;
}
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* KẾT QUẢ REALTIME */
.po-result-section { margin-top: 30px; border-top: 4px dashed #000; padding-top: 30px; transition: 0.2s;}

.res-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; }
.res-card { text-align: center; border: 3px solid #000; border-radius: 12px; padding: 25px; box-shadow: 6px 6px 0px #000; display: flex; flex-direction: column; justify-content: center;}
.highlight-card { border-width: 5px; }

.res-title { font-size: 1.1rem; font-weight: 900; text-transform: uppercase; margin: 0 0 10px 0;}
.res-value { font-family: 'Bungee', cursive; line-height: 1; text-shadow: 2px 2px 0px rgba(0,0,0,0.1); word-break: break-word; margin-bottom: 15px;}
.final-price { font-size: 3rem; color: #1982c4; }
.saved-price { font-size: 2.2rem; color: #2d6a4f; }

.res-sub-box { background: rgba(255,255,255,0.6); border: 2px dashed #000; border-radius: 8px; padding: 10px; font-size: 0.95rem; font-weight: 700; color: #222; display: flex; justify-content: space-between; align-items: center;}
.avg-badge { background: #ff595e; color: #fff; padding: 4px 8px; border-radius: 6px; border: 2px solid #000; font-family: 'Courier New', monospace; font-size: 1.2rem;}

@media (max-width: 768px) {
    .po-grid, .res-grid { grid-template-columns: 1fr; }
    .final-price { font-size: 2.5rem; }
}