/* ====================================================
   BUHALTERIJOS MODULIO STILIUS V6 (Progress Bar, Export & Split-Screen)
   ==================================================== */

.tf-buhalterija { font-family: 'Inter', sans-serif; color: var(--tf-text-main); }

/* Headeris su eksporto mygtuku */
.tf-header-flex { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 25px; flex-wrap: wrap; gap: 15px; }
.tf-header-flex h3 { margin: 0 0 5px 0; font-size: 24px; font-weight: 800; letter-spacing: -0.5px; color: var(--tf-text-heading); }
.tf-header-flex p { margin: 0; color: var(--tf-text-muted); font-size: 14px; }
.tf-btn-export { background: rgba(16, 185, 129, 0.1); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); padding: 10px 16px; border-radius: 8px; font-weight: 700; font-size: 13px; cursor: pointer; transition: 0.2s; font-family: inherit; }
.tf-btn-export:hover { background: #10b981; color: white; }

/* Pranešimai */
.tf-success-msg, .tf-error-msg { padding: 15px 20px; border-radius: 12px; margin-bottom: 20px; font-weight: 600; font-size: 14px; animation: fadeIn 0.4s; }
.tf-success-msg { background: rgba(16, 185, 129, 0.1); color: #10b981; border-left: 5px solid #10b981; }
.tf-error-msg { background: rgba(239, 68, 68, 0.1); color: #ef4444; border-left: 5px solid #ef4444; }

/* PROGRESO JUOSTA */
.tf-progress-card { background: var(--tf-bg-card); padding: 20px; border-radius: 16px; border: 1px solid var(--tf-border); margin-bottom: 25px; box-shadow: 0 4px 6px rgba(0,0,0,0.02); }
.tf-progress-header { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--tf-text-heading); margin-bottom: 10px; }
.tf-progress-bar-bg { width: 100%; height: 10px; background: var(--tf-input-bg); border-radius: 10px; overflow: hidden; border: 1px solid var(--tf-border); }
.tf-progress-fill { height: 100%; background: var(--tf-primary); border-radius: 10px; transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.5s; }

/* Išdėstymas */
.tf-buh-layout { display: flex; gap: 30px; align-items: flex-start; flex-wrap: wrap; }
.tf-buh-sidebar { flex: 1; min-width: 240px; max-width: 300px; background: var(--tf-bg-card); padding: 20px; border-radius: 16px; border: 1px solid var(--tf-border); position: sticky; top: 20px; }
.tf-buh-content { flex: 3; min-width: 300px; }

/* Medžio meniu */
.tf-tree-all { display: block; padding: 10px 15px; margin-bottom: 15px; background: var(--tf-bg-box); border-radius: 8px; font-weight: 700; color: var(--tf-text-heading); text-decoration: none; transition: 0.2s; border: 1px solid var(--tf-border); }
.tf-tree-all:hover, .tf-tree-all.active { background: var(--tf-primary); color: white; border-color: var(--tf-primary); }
.tf-tree-details { margin-bottom: 10px; }
.tf-tree-year { cursor: pointer; padding: 10px; font-weight: 700; color: var(--tf-text-heading); user-select: none; border-radius: 8px; transition: 0.2s; }
.tf-tree-year:hover { background: var(--tf-bg-box); }
.tf-tree-month-list { padding-left: 20px; margin-top: 5px; display: flex; flex-direction: column; gap: 4px; border-left: 2px solid var(--tf-border); margin-left: 10px; }
.tf-tree-month { display: block; padding: 8px 12px; color: var(--tf-text-muted); text-decoration: none; font-size: 13px; border-radius: 6px; transition: 0.2s; }
.tf-tree-month:hover { color: var(--tf-primary); background: rgba(37,99,235,0.05); }
.tf-tree-month.active { font-weight: 700; color: var(--tf-primary); background: rgba(37,99,235,0.1); }

/* Antraštės */
.tf-section-title { font-size: 18px; font-weight: 800; margin: 0 0 15px 0; border-bottom: 2px solid; padding-bottom: 10px; }
.tf-section-title.green { color: #10b981; border-color: rgba(16, 185, 129, 0.2); }
.tf-section-title.red { color: #ef4444; border-color: rgba(239, 68, 68, 0.2); }

.tf-summary-row { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; background: var(--tf-bg-card); border-radius: 12px; font-size: 16px; font-weight: 800; border: 1px solid var(--tf-border); border-top-width: 4px; box-shadow: 0 4px 6px rgba(0,0,0,0.02); }
.tf-summary-row.green { border-top-color: #10b981; }
.tf-summary-row.red { border-top-color: #ef4444; }

/* ================== ĮKĖLIMO BOX'AS IR TABS ================== */
.tf-upload-box { background: var(--tf-bg-card); border: 2px dashed var(--tf-border); border-radius: 16px; padding: 30px; margin-bottom: 40px; transition: 0.3s; }
.tf-upload-box:focus-within { border-color: var(--tf-primary); }

.tf-upload-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--tf-border); padding-bottom: 15px; margin-bottom: 15px; flex-wrap: wrap; gap: 15px; }

.tf-upload-tabs { display: flex; gap: 10px; background: var(--tf-bg-box); padding: 5px; border-radius: 10px; border: 1px solid var(--tf-border); }
.tf-radio-btn { padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--tf-text-muted); transition: 0.2s; user-select: none; }
.tf-radio-btn input { display: none; }
.tf-radio-btn:hover { color: var(--tf-text-heading); }
.tf-radio-btn.active { background: var(--tf-bg-card); color: var(--tf-primary); box-shadow: 0 2px 4px rgba(0,0,0,0.05); border: 1px solid rgba(37,99,235,0.1); }

.tf-input { padding: 12px 15px; border: 1px solid var(--tf-border); border-radius: 8px; font-family: inherit; font-size: 13px; color: var(--tf-text-main); background: var(--tf-input-bg); transition: 0.2s; outline: none; }
.tf-input:focus { border-color: var(--tf-primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.tf-btn-primary { background: var(--tf-primary); color: white; border: none; padding: 12px 20px; border-radius: 8px; font-weight: 700; cursor: pointer; transition: 0.2s; }
.tf-btn-primary:hover { filter: brightness(0.9); transform: translateY(-1px); }
/* Išlaidų įkėlimas */
.tf-upload-box { background: var(--tf-bg-card); border: 2px dashed var(--tf-border); border-radius: 16px; padding: 30px; margin-bottom: 40px; }
.tf-input { padding: 12px 15px; border: 1px solid var(--tf-border); border-radius: 8px; font-family: inherit; font-size: 13px; color: var(--tf-text-main); background: var(--tf-input-bg); transition: 0.2s; outline: none; }
.tf-input:focus { border-color: var(--tf-primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.tf-btn-primary { background: var(--tf-primary); color: white; border: none; padding: 12px 20px; border-radius: 8px; font-weight: 700; cursor: pointer; transition: 0.2s; }
.tf-btn-primary:hover { filter: brightness(0.9); transform: translateY(-1px); }

/* DOKUMENTŲ KORTELĖS */
.tf-docs-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.tf-doc-card { display: flex; justify-content: space-between; align-items: center; background: var(--tf-bg-card); border: 1px solid var(--tf-border); border-radius: 12px; padding: 14px 20px; transition: all 0.2s; gap: 20px; }
.tf-doc-card:hover { border-color: var(--tf-primary); box-shadow: 0 4px 10px rgba(0,0,0,0.03); transform: translateY(-1px); }

.tf-doc-card.is-suvesta { background: var(--tf-bg-box); opacity: 0.8; border-style: dashed; }
.tf-doc-card.is-suvesta .tf-doc-col-title { text-decoration: line-through; color: var(--tf-text-muted); }

.tf-doc-info { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tf-doc-col-title { font-weight: 800; font-size: 15px; color: var(--tf-text-heading); }

.tf-doc-details { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tf-doc-col-nr { font-size: 12px; font-weight: 800; color: var(--tf-text-heading); background: var(--tf-bg-box); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--tf-border); }
.tf-doc-col-date { font-size: 13px; color: var(--tf-text-muted); font-weight: 600; }
.tf-doc-col-price { font-size: 15px; font-weight: 800; }

.tf-doc-controls { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.tf-doc-col-actions { display: flex; gap: 6px; }
.tf-btn-chat, .tf-btn-doc { padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 700; text-decoration: none; cursor: pointer; transition: 0.2s; border: 1px solid transparent; font-family: inherit; display: inline-flex; align-items: center; white-space: nowrap; }

.tf-btn-chat { background: var(--tf-bg-box); color: var(--tf-text-muted); border-color: var(--tf-border); }
.tf-btn-chat:hover { background: var(--tf-primary); color: white; border-color: var(--tf-primary); }
.tf-btn-chat.has-msg { background: rgba(37, 99, 235, 0.1); color: var(--tf-primary); border-color: rgba(37, 99, 235, 0.2); }
.tf-btn-chat.unread { background: #ef4444; color: white; border-color: #ef4444; animation: pulse 2s infinite; }

.tf-btn-doc.pdf { background: rgba(16, 185, 129, 0.1); color: #10b981; border-color: rgba(16, 185, 129, 0.2); }
.tf-btn-doc.pdf:hover { background: #10b981; color: white; }
.tf-btn-doc.attach { background: var(--tf-bg-box); color: var(--tf-text-main); border-color: var(--tf-border); }
.tf-btn-doc.attach:hover { background: var(--tf-text-heading); color: var(--tf-bg-card); }

/* Toggle Slider */
.tf-toggle-wrap { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.tf-toggle-wrap input { display: none; }
.tf-toggle-slider { position: relative; width: 32px; height: 18px; background-color: var(--tf-border); border-radius: 20px; transition: .3s; flex-shrink: 0; }
.tf-toggle-slider:before { content: ""; position: absolute; height: 12px; width: 12px; left: 3px; bottom: 3px; background-color: white; border-radius: 50%; transition: .3s; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.tf-toggle-wrap input:checked + .tf-toggle-slider { background-color: #10b981; }
.tf-toggle-wrap input:checked + .tf-toggle-slider:before { transform: translateX(14px); }
.tf-toggle-text { font-size: 11px; font-weight: 700; color: var(--tf-text-muted); text-transform: uppercase; }
.tf-toggle-wrap input:checked ~ .tf-toggle-text { color: #10b981; }
.tf-empty-state { padding: 30px; text-align: center; color: var(--tf-text-muted); background: var(--tf-bg-box); border-radius: 12px; border: 1px dashed var(--tf-border); font-size: 14px; }


/* ====================================================
   SPLIT-SCREEN ŠONINIS LANGAS PERŽIŪRAI
   ==================================================== */
.tf-sidepanel-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15,23,42,0.4); z-index: 99998; opacity: 0; pointer-events: none; transition: opacity 0.3s; backdrop-filter: blur(2px); }
.tf-sidepanel-overlay.active { opacity: 1; pointer-events: auto; }

.tf-sidepanel { position: fixed; top: 0; right: -50%; width: 50%; height: 100vh; background: var(--tf-bg-card); z-index: 99999; box-shadow: -5px 0 30px rgba(0,0,0,0.15); display: flex; flex-direction: column; transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1); border-left: 1px solid var(--tf-border); }
.tf-sidepanel.active { right: 0; }

.tf-sidepanel-header { padding: 15px 20px; background: var(--tf-bg-box); border-bottom: 1px solid var(--tf-border); display: flex; justify-content: space-between; align-items: center; }
.tf-sidepanel-header h4 { margin: 0; font-size: 16px; font-weight: 800; color: var(--tf-text-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 80%; }
.tf-btn-close-panel { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2); color: #ef4444; padding: 6px 12px; border-radius: 6px; font-weight: 700; font-size: 12px; cursor: pointer; transition: 0.2s; }
.tf-btn-close-panel:hover { background: #ef4444; color: white; }

.tf-sidepanel-body { flex: 1; overflow: hidden; background: #e2e8f0; } /* Šviesiai pilkas fonas PDF/Nuotraukoms */

/* Senas modalas (paliekamas tik failų įkėlimo formos peržiūrai) */
.tf-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15,23,42,0.8); z-index: 99999; display: none; align-items: center; justify-content: center; backdrop-filter: blur(4px); opacity: 0; transition: opacity 0.2s; }
.tf-modal-content { background: var(--tf-bg-card); width: 95%; border-radius: 12px; padding: 20px; }

/* PRITAIKYMAS TELEFONAMS */
@media (max-width: 900px) {
    .tf-doc-card { flex-direction: column; align-items: flex-start; }
    .tf-doc-controls { width: 100%; flex-direction: row; justify-content: space-between; align-items: center; border-top: 1px solid var(--tf-border); padding-top: 10px; margin-top: 5px; }
    
    /* Šoninis langas telefone tampa beveik per visą ekraną */
    .tf-sidepanel { width: 85%; right: -85%; }
}
@media (max-width: 600px) {
    .tf-sidepanel { width: 100%; right: -100%; }
}