/* Biến nội bộ */
.dep-neo-wrapper {
    --bg-white: #ffffff;
    --border-ink: 3px solid #111111;
    --shadow-solid: 5px 5px 0px #111111;
    --shadow-push: 2px 2px 0px #111111;
    
    /* Bảng màu Tài chính */
    --clr-money: #2a9d8f;    /* Xanh kế toán */
    --clr-asset: #e9c46a;    /* Vàng tài sản */
    --clr-expense: #e76f51;  /* Đỏ chi phí */
    --clr-bg: #f8f9fa;

    max-width: 900px;
    margin: 0 auto;
    font-family: system-ui, -apple-system, sans-serif;
    color: #111111;
    background: var(--clr-bg);
    padding: 20px;
    border: var(--border-ink);
    border-radius: 16px;
    box-shadow: 8px 8px 0px #111;
}
/* Real-time Currency Format */
.live-currency-format {
    font-size: 0.95rem;
    font-weight: 900;
    color: var(--clr-money); /* Sử dụng màu xanh tiền tệ */
    margin-top: 2px;
    padding-left: 5px;
    min-height: 1.2em; /* Đặt chiều cao tối thiểu để form không bị giật khi gõ chữ */
    transition: all 0.2s;
    letter-spacing: 0.5px;
}
.dep-neo-wrapper * { box-sizing: border-box; }

.dep-neo-header { background: var(--clr-money); color: #fff; border: var(--border-ink); box-shadow: var(--shadow-solid); padding: 20px; border-radius: 12px; text-align: center; margin-bottom: 25px; }
.dep-neo-header h2 { margin: 0 0 10px 0; font-size: 1.8rem; font-weight: 900; text-transform: uppercase; letter-spacing: 1px;}
.dep-neo-header p { margin: 0; font-weight: 800; font-size: 0.95rem; }

/* Tabs Chế độ */
.dep-mode-toggle { display: flex; gap: 15px; margin-bottom: 20px; }
.radio-mode { flex: 1; cursor: pointer; }
.radio-mode input { display: none; }
.radio-mode .neo-content { display: block; text-align: center; padding: 14px; font-weight: 900; border: var(--border-ink); border-radius: 12px; background: var(--bg-white); box-shadow: 4px 4px 0px #111; transition: all 0.15s; color: #111; font-size: 1.05rem;}
.radio-mode input:checked + .neo-content { background: #111; color: #fff; box-shadow: var(--shadow-push); transform: translate(2px, 2px); }

.dep-neo-form { display: flex; flex-direction: column; gap: 20px; }
.dep-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dep-group { display: flex; flex-direction: column; gap: 10px; }
.dep-group label { font-weight: 900; font-size: 1.05rem; color: #111; }

/* CSS FIX CHUẨN Ô INPUT & SELECT */
.input-with-select { 
    display: flex; flex-wrap: nowrap; align-items: stretch; border: var(--border-ink); border-radius: 12px; box-shadow: 4px 4px 0px #111; background: #fff; overflow: hidden; width: 100%;
}
.input-with-select input { 
    border: none !important; border-radius: 0 !important; box-shadow: none !important; flex: 1; width: 100%; min-width: 50%; padding: 16px 15px !important; font-size: 1.2rem !important; font-weight: 900; color: #111; outline: none;
}
.input-with-select select { 
    border: none; border-left: 3px solid #111; padding: 0 15px; font-weight: 900; font-size: 1rem; background: #e9ecef; outline: none; cursor: pointer; color: #111; flex: 0 0 auto; width: 80px; text-align: center;
}
.input-with-select select:disabled { opacity: 1; background: #e9ecef;}
.input-with-select input:focus, .input-with-select select:focus { background: #e0fbfc; }

/* Quick Tags */
.input-with-quick { display: flex; flex-direction: column; gap: 10px; }
.quick-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.q-tag { padding: 4px 12px; border: 2px solid #111; border-radius: 20px; font-size: 0.85rem; font-weight: 800; cursor: pointer; background: #fff; box-shadow: 2px 2px 0px #111; color: #111; transition: transform 0.1s;}
.q-tag:hover { background: var(--clr-asset); }
.q-tag:active { box-shadow: 0px 0px 0px #111; transform: translate(2px,2px); }

.dep-error-alert { background: var(--clr-expense); color: #fff; border: var(--border-ink); padding: 12px; border-radius: 8px; font-weight: 800; text-align: center; }

/* Button */
.dep-neo-btn { padding: 18px; font-size: 1.2rem; font-weight: 900; background: #111; color: #fff; border: var(--border-ink); border-radius: 12px; box-shadow: 5px 5px 0px var(--clr-money); cursor: pointer; text-transform: uppercase; transition: all 0.1s; margin-top: 5px; letter-spacing: 1px;}
.dep-neo-btn:active { box-shadow: 2px 2px 0px var(--clr-money); transform: translate(3px, 3px); }

/* Result Layout */
.dep-neo-result { margin-top: 30px; padding-top: 25px; border-top: 4px dashed #111; display: flex; flex-direction: column; gap: 25px;}
.dep-neo-result.active { display: flex !important; animation: depAnim 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }

.dep-result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.dep-card { border: var(--border-ink); box-shadow: var(--shadow-solid); border-radius: 12px; padding: 25px 15px; text-align: center; display: flex; flex-direction: column; justify-content: center; align-items: center;}
.card-main { background: var(--clr-money); color: #fff; }
.card-sub { background: var(--clr-asset); color: #111; }

.dep-card h4 { margin: 0 0 10px 0; font-size: 1.1rem; font-weight: 900; text-transform: uppercase;}
.val-text { font-size: 2.2rem; font-weight: 900; line-height: 1.2; margin-bottom: 5px; word-break: break-all;}
.val-desc { margin: 0; font-size: 1.1rem; font-weight: 900; background: rgba(0,0,0,0.1); padding: 4px 15px; border-radius: 20px;}

/* Hướng dẫn giải */
.dep-solution-box { background: #fff; border: var(--border-ink); border-radius: 12px; padding: 20px; box-shadow: var(--shadow-solid);}
.dep-solution-box h3 { margin: 0 0 15px 0; font-size: 1.2rem; font-weight: 900; text-transform: uppercase; border-bottom: 3px solid #111; padding-bottom: 10px;}
.math-line { font-family: monospace, system-ui; font-size: 1.15rem !important; font-weight: 900 !important; color: #111 !important; background: #f8f9fa; padding: 15px; border-radius: 8px; border: 2px solid #111; overflow-x: auto;}

/* CANVAS ĐỒ THỊ */
.dep-canvas-box { background: #fff; border: var(--border-ink); border-radius: 12px; padding: 20px; box-shadow: var(--shadow-solid); text-align: center;}
.dep-canvas-box h3 { margin: 0 0 15px 0; font-size: 1.2rem; font-weight: 900; text-transform: uppercase;}
#depCanvas { width: 100%; max-width: 100%; height: auto; border: 2px solid #111; border-radius: 8px; background: #fafafa;}

.canvas-legend { display: flex; justify-content: center; gap: 20px; margin-top: 15px; flex-wrap: wrap;}
.lg-item { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 0.95rem;}
.lg-color { width: 15px; height: 15px; border: 2px solid #111; border-radius: 3px; }
.bg-bookvalue { background: var(--clr-money); }
.bg-salvage { background: var(--clr-expense); }

/* Bảng Kế Toán */
.dep-table-box { background: #fff; border: var(--border-ink); border-radius: 12px; padding: 20px; box-shadow: var(--shadow-solid);}
.dep-table-box h3 { margin: 0 0 15px 0; font-size: 1.2rem; font-weight: 900; text-transform: uppercase; border-bottom: 3px solid #111; padding-bottom: 10px;}
.table-responsive { overflow-x: auto; }
.neo-table { width: 100%; border-collapse: collapse; text-align: right; font-family: monospace, system-ui; font-size: 1.05rem;}
.neo-table th, .neo-table td { border: 2px solid #111; padding: 12px; font-weight: 700; white-space: nowrap;}
.neo-table th { background: #111; color: #fff; text-align: center; text-transform: uppercase; font-family: system-ui, sans-serif; font-weight: 900;}
.neo-table tbody tr:nth-child(even) { background: #f8f9fa; }
.neo-table tbody tr:hover { background: #e0fbfc; }
.neo-table td:first-child { text-align: center; font-weight: 900; } /* Cột Năm */

@keyframes depAnim { 0% { opacity: 0; transform: translateY(20px); } 100% { opacity: 1; transform: translateY(0); } }

@media (max-width: 700px) {
    .dep-form-grid, .dep-result-grid { grid-template-columns: 1fr; }
}