/* ====================================================
   APMOKĖJIMŲ MODULIO STILIUS V2 (Kortelės, Paieška, Vėlavimai)
   ==================================================== */

.tf-apmokejimai { font-family: 'Inter', sans-serif; color: var(--tf-text-main); }
.tf-apmokejimai a { text-decoration: none !important; }
/* Header ir Filtrai */
.tf-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 25px; flex-wrap: wrap; gap: 15px; }
.tf-header h3 { margin: 0 0 5px 0; font-size: 24px; font-weight: 800; color: var(--tf-text-heading); transition: color 0.3s; }
.tf-header p { margin: 0; color: var(--tf-text-muted); font-size: 14px; transition: color 0.3s; }

.tf-filters { display: flex; gap: 8px; background: var(--tf-bg-card); padding: 6px; border-radius: 12px; border: 1px solid var(--tf-border); box-shadow: 0 2px 4px rgba(0,0,0,0.02); transition: all 0.3s; flex-wrap: wrap; }
.tf-filter-btn { padding: 8px 16px; border-radius: 8px; text-decoration: none; font-size: 13px; font-weight: 700; color: var(--tf-text-muted); transition: all 0.2s ease; white-space: nowrap; }
.tf-filter-btn:hover { color: var(--tf-primary); background: var(--tf-bg-box); }
.tf-filter-btn.active { background: var(--tf-primary); color: #fff; box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2); }

/* Pranešimai */
.tf-success-msg, .tf-notify-msg, .tf-error-msg { padding: 15px 20px; border-radius: 12px; margin-bottom: 25px; font-weight: 600; display: flex; align-items: center; gap: 10px; transition: opacity 0.5s; }
.tf-success-msg { background: rgba(16, 185, 129, 0.1); color: #10b981; border-left: 5px solid #10b981; }
.tf-notify-msg { background: rgba(37, 99, 235, 0.1); color: #2563eb; border-left: 5px solid #2563eb; }
.tf-error-msg { background: rgba(239, 68, 68, 0.1); color: #ef4444; border-left: 5px solid #ef4444; }

/* Paieškos ir Rūšiavimo juosta */
.tf-controls-bar { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 20px; flex-wrap: wrap; }
.tf-search-wrap { position: relative; flex: 1; min-width: 250px; }
.tf-search-wrap input { width: 100%; padding: 14px 15px 14px 45px; border: 1px solid var(--tf-border); border-radius: 12px; font-size: 14px; font-family: inherit; color: var(--tf-text-main); background: var(--tf-bg-card); box-shadow: 0 4px 6px rgba(0,0,0,0.02); transition: all 0.3s; outline: none; box-sizing: border-box; }
.tf-search-wrap input:focus { border-color: var(--tf-primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.tf-search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--tf-text-muted); display: flex; align-items: center; justify-content: center; pointer-events: none; }

.tf-sort-wrap { min-width: 220px; flex-shrink: 0; }
.tf-sort-select { 
    width: 100%; 
    height: 48px; /* Fiksuotas aukštis idealiam centravimui */
    padding: 0 40px 0 15px; /* Paliekame vietos rodyklei dešinėje */
    border: 1px solid var(--tf-border); 
    border-radius: 12px; 
    font-size: 14px; 
    font-weight: 600; 
    font-family: inherit; 
    color: var(--tf-text-main); 
    background-color: var(--tf-bg-card); 
    box-shadow: 0 4px 6px rgba(0,0,0,0.02); 
    outline: none; 
    cursor: pointer; 
    transition: 0.2s;
    box-sizing: border-box;
    
    /* IŠJUNGIAME standartinį naršyklės stilių, kuris viską kraipo */
    appearance: none; 
    -webkit-appearance: none; 
    -moz-appearance: none;
    
    /* Įdedame savo elegantišką SVG rodyklę žemyn */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
}
.tf-sort-select:focus { border-color: var(--tf-primary); }

/* ================== KORTELIŲ SĄRAŠAS ================== */
.tf-apm-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 30px; }

/* Kortelės Grid sistema (Tobula horizontali linija) */
.tf-apm-card { 
    display: grid; 
    grid-template-columns: 100px 1fr 140px 120px auto; 
    align-items: center; 
    background: var(--tf-bg-card); 
    border: 1px solid var(--tf-border); 
    border-radius: 10px; 
    padding: 12px 20px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.02); 
    transition: all 0.2s ease; 
    gap: 15px; 
}
.tf-apm-card:hover { border-color: var(--tf-primary); transform: translateX(3px); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }

/* Stulpelių turinys */
.tf-apm-col-nr { display: flex; align-items: center; }
.tf-apm-nr { font-size: 13px; font-weight: 800; color: var(--tf-text-heading); background: var(--tf-bg-box); padding: 4px 8px; border-radius: 6px; border: 1px solid var(--tf-border); letter-spacing: 0.5px; }

.tf-apm-client { color: var(--tf-primary); text-decoration: none; font-weight: 700; font-size: 14px; transition: color 0.2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.tf-apm-client:hover { text-decoration: none !important; color: var(--tf-text-heading); }

.tf-apm-col-date { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.tf-apm-date { color: var(--tf-text-muted); font-size: 13px; font-weight: 500; }
.tf-badge-overdue { display: inline-flex; align-items: center; background: rgba(239, 68, 68, 0.1); color: #ef4444; padding: 4px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; margin-top: 4px; border: 1px solid rgba(239, 68, 68, 0.2); }

.tf-apm-suma { font-size: 16px; font-weight: 800; color: var(--tf-text-heading); }

/* Dešinė pusė (Veiksmai) - STULPELIS (kad tekstas būtų po mygtukais) */
.tf-apm-actions-col { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; }
.tf-apm-actions-row { display: flex; gap: 8px; }
.tf-inline-form { margin: 0; }

.tf-btn-status { padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 800; cursor: pointer; border: 1px solid transparent; font-family: inherit; transition: all 0.2s; display: inline-flex; align-items: center; gap: 6px; }
.tf-btn-status:hover { filter: brightness(0.95); transform: translateY(-1px); }
.status-red { background: rgba(239, 68, 68, 0.1); color: #ef4444; border-color: rgba(239, 68, 68, 0.2); }
.status-red:hover { background: #ef4444; color: white; }
.status-green { background: rgba(16, 185, 129, 0.1); color: #10b981; border-color: rgba(16, 185, 129, 0.2); }
.status-green:hover { background: #10b981; color: white; }

.tf-btn-remind { background: transparent; color: var(--tf-text-muted); border: 1px dashed var(--tf-border); padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 700; cursor: pointer; transition: all 0.2s; font-family: inherit; }
.tf-btn-remind:hover { background: rgba(37, 99, 235, 0.1); color: var(--tf-primary); border-color: var(--tf-primary); border-style: solid; }

.tf-apm-reminder-note { font-size: 11px; color: var(--tf-text-muted); font-style: italic; margin-top: 6px; }

/* Puslapiavimas */
.tf-pagination { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding-top: 15px; border-top: 1px solid var(--tf-border); }
.tf-page-btn { padding: 6px 12px; border: 1px solid var(--tf-border); background: var(--tf-bg-card); border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--tf-text-muted); transition: all 0.2s; }
.tf-page-btn:hover { background: var(--tf-bg-box); color: var(--tf-text-heading); }
.tf-page-btn.active { background: var(--tf-primary); color: #fff; border-color: var(--tf-primary); box-shadow: 0 4px 10px rgba(37,99,235,0.2); }
.tf-page-info { font-size: 13px; font-weight: 600; color: var(--tf-text-muted); margin-right: auto; }

/* Modalas */
.tf-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15,23,42,0.7); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 99999; opacity: 0; transition: opacity 0.3s; }
.tf-modal-content { background: var(--tf-bg-card); padding: 30px; border-radius: 16px; width: 100%; max-width: 480px; box-shadow: 0 20px 40px rgba(0,0,0,0.3); transform: translateY(20px); transition: all 0.3s; border: 1px solid var(--tf-border); height: max-content !important; max-height: 90vh; overflow-y: auto; margin: auto; }
.tf-modal-content.active { transform: translateY(0); }
.tf-modal-title { margin: 0 0 10px 0; color: var(--tf-text-heading); font-size: 20px; font-weight: 800; }
.tf-modal-desc { font-size: 14px; color: var(--tf-text-muted); margin-bottom: 25px; line-height: 1.5; }

.tf-form-group { margin-bottom: 16px; }
.tf-form-group label { display: block; font-size: 12px; font-weight: 700; color: var(--tf-text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.tf-input { width: 100%; padding: 12px 15px; border: 1px solid var(--tf-border); border-radius: 10px; font-family: inherit; font-size: 14px; color: var(--tf-text-main); background: var(--tf-input-bg); outline: none; box-sizing: border-box; transition: 0.2s; }
.tf-input:focus { border-color: var(--tf-primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.tf-form-group small { display: block; margin-top: 6px; color: var(--tf-text-muted); font-size: 12px; }

.tf-modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 25px; }
.tf-btn-cancel { padding: 12px 20px; background: transparent; color: var(--tf-text-muted); border: 1px dashed var(--tf-border); border-radius: 10px; cursor: pointer; font-weight: 700; transition: 0.2s; font-family: inherit; }
.tf-btn-cancel:hover { background: var(--tf-bg-box); color: var(--tf-text-heading); border-style: solid; }
.tf-btn-send { padding: 12px 24px; background: var(--tf-primary); color: white; border: none; border-radius: 10px; cursor: pointer; font-weight: 800; transition: 0.2s; font-family: inherit; box-shadow: 0 4px 10px rgba(37,99,235,0.2); }
.tf-btn-send:hover { filter: brightness(0.9); transform: translateY(-1px); }

.tf-empty-state { padding: 40px; background: var(--tf-bg-card); border: 2px dashed var(--tf-border); border-radius: 16px; text-align: center; color: var(--tf-text-muted); font-size: 15px; font-weight: 600; margin-top: 20px; }

/* Responsive pritaikymas */
@media (max-width: 900px) {
    .tf-apm-card { grid-template-columns: 1fr; gap: 10px; padding: 15px; }
    .tf-apm-actions-col { align-items: flex-start; margin-top: 10px; }
}