/* Kıdem Tazminatı — İş Hayatı #303F9F */

/* TAB BAR */
.severance-calc .calc-tabs { display: flex; gap: 4px; border-bottom: 2px solid #e2e8f0; margin-bottom: 1.5rem; padding: 0 4px; }
.severance-calc .calc-tab { background: transparent; border: none; padding: 0.85rem 1.5rem; font-size: 0.95rem; font-weight: 700; color: #64748b; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; display: inline-flex; align-items: center; gap: 8px; transition: color 0.15s, border-color 0.15s; font-family: inherit; position: relative; }
.severance-calc .calc-tab:hover:not(:disabled) { color: #303F9F; }
.severance-calc .calc-tab.active { color: #303F9F; border-bottom-color: #303F9F; }
.severance-calc .calc-tab:disabled { cursor: not-allowed; opacity: 0.45; }
.severance-calc .calc-tab i { font-size: 1.05rem; }
.severance-calc .calc-tab-badge { background: #16a34a; color: #fff; font-size: 0.65rem; font-weight: 800; padding: 2px 7px; border-radius: 10px; margin-left: 4px; letter-spacing: 0.04em; text-transform: uppercase; animation: badgePulse 1.4s ease-in-out 2; }
@keyframes badgePulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.severance-calc .calc-tab-panel { animation: panelFadeIn 0.25s ease; }
.severance-calc .calc-tab-panel[hidden] { display: none; }
@keyframes panelFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.severance-calc .severance-row.calc-input-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; margin-bottom: 1.5rem; }
.severance-calc .calc-input-col input.calc-field { width: 100%; padding: 0.75rem 1rem; font-size: 1rem; border: 1px solid #e0e0e0; border-radius: 8px; background-color: #fff; height: 46px; font-family: inherit; }
.severance-calc .calc-input-col input.calc-field:focus { outline: none; border-color: var(--cat-bg, #303F9F); box-shadow: 0 0 0 3px rgba(48, 63, 159, 0.15); }
.severance-calc .calc-input-col label { display: block; margin-bottom: 0.5rem; font-weight: 700; color: #1e293b; font-size: 0.95rem; }
.severance-calc .severance-results.calc-results-grid, .severance-calc .severance-results-extra.calc-results-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1rem; }
.severance-calc .severance-results-extra .res-box { background: #f8fafc; }

/* HEADLINE — büyük net kıdem öne çıkar */
.severance-calc .sev-headline-result { background: #303F9F; color: #fff; padding: 1.5rem 2rem; border-radius: 14px; display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.5rem; box-shadow: 0 6px 20px rgba(48, 63, 159, 0.25); flex-wrap: wrap; }
.severance-calc .sev-headline-result .headline-label { font-size: 0.95rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.92; }
.severance-calc .sev-headline-result .headline-value { font-size: 2.4rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -0.02em; }

/* Receipt-style sonuç listeleri — label SOLA, rakam SAĞA */
.severance-calc .sev-result-list { list-style: none; margin: 0 0 10px; padding: 0; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; }
.severance-calc .sev-result-list:last-of-type { margin-bottom: 1rem; }
.severance-calc .sev-result-list li { display: flex; justify-content: space-between; align-items: baseline; padding: 0.95rem 1.25rem; border-bottom: 1px solid #f1f5f9; gap: 1.25rem; }
.severance-calc .sev-result-list li:last-child { border-bottom: none; }
.severance-calc .sev-result-list li:nth-child(odd) { background: #fafbfc; }
.severance-calc .sev-result-list .r-label { color: #475569; font-weight: 600; font-size: 0.95rem; text-align: left; flex: 1; }
.severance-calc .sev-result-list .r-label small { font-weight: 500; color: #94a3b8; font-size: 0.82em; }
.severance-calc .sev-result-list .r-value { color: #1e293b; font-weight: 700; font-size: 1.05rem; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.severance-calc .sev-result-list .r-value.text-muted { color: #64748b; font-weight: 600; }
/* İkinci kart hafif farklı renk tonu — görsel ayrım için */
.severance-calc .sev-result-list--secondary { background: #fdfdfe; }
.severance-calc .sev-result-list--secondary li:nth-child(odd) { background: #f5f7fa; }

/* Readonly tavan input — 4. kolonda, çıkış tarihine göre otomatik */
.severance-calc .cap-readonly { background: rgba(48,63,159,0.09) !important; color: #303F9F !important; font-weight: 700 !important; font-variant-numeric: tabular-nums; cursor: not-allowed; border-color: #303F9F40 !important; }
.severance-calc .cap-readonly:focus { outline: none !important; box-shadow: none !important; border-color: #303F9F40 !important; }
.severance-calc .cap-period-hint { display: block; margin-top: 0.4rem; font-size: 0.75rem; color: #64748b; line-height: 1.3; min-height: 1em; }

/* Kıdem Tavanı Tarihçesi — accordion */
.severance-calc .cap-history { margin: 1rem 0 1.5rem; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; overflow: hidden; }
.severance-calc .cap-history summary { padding: 12px 18px; cursor: pointer; font-weight: 700; color: #303F9F; background: #f8fafc; border-bottom: 1px solid transparent; user-select: none; list-style: none; display: flex; align-items: center; gap: 10px; }
.severance-calc .cap-history summary::-webkit-details-marker { display: none; }
.severance-calc .cap-history summary::before { content: '▸'; transition: transform 0.2s; font-size: 0.75rem; }
.severance-calc .cap-history[open] summary { border-bottom-color: #e2e8f0; }
.severance-calc .cap-history[open] summary::before { transform: rotate(90deg); }
.severance-calc .cap-history-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; table-layout: fixed; }
.severance-calc .cap-history-table th { background: #f8fafc; padding: 10px 14px; font-weight: 700; color: #475569; border-bottom: 1px solid #e2e8f0; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.severance-calc .cap-history-table td { padding: 10px 14px; border-bottom: 1px solid #f1f5f9; color: #334155; font-variant-numeric: tabular-nums; }
/* SOL: tarih kolonları (1, 2) — başlık + değer aynı hizada */
.severance-calc .cap-history-table th:nth-child(1),
.severance-calc .cap-history-table td:nth-child(1),
.severance-calc .cap-history-table th:nth-child(2),
.severance-calc .cap-history-table td:nth-child(2) { text-align: left; }
/* SAĞ: Tutar (3) — başlık + değer sağa */
.severance-calc .cap-history-table th:nth-child(3),
.severance-calc .cap-history-table td:nth-child(3) { text-align: right; }
/* SOL: Kaynak (4) — başlık + değer sola (uzun text) */
.severance-calc .cap-history-table th:nth-child(4),
.severance-calc .cap-history-table td:nth-child(4) { text-align: left; }
.severance-calc .cap-history-table tr:last-child td { border-bottom: none; }
.severance-calc .cap-history-table tr.is-current { background: rgba(48,63,159,0.05); }
.severance-calc .cap-history-table tr.is-current td { font-weight: 700; color: #303F9F; }
.severance-calc .cap-history-table tr.is-current td:first-child { position: relative; padding-left: 28px; }
.severance-calc .cap-history-table tr.is-current td:first-child::before { content: ''; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 8px; height: 8px; border-radius: 50%; background: #303F9F; box-shadow: 0 0 0 3px rgba(48, 63, 159, 0.2); }
.severance-calc .cap-history-source { color: #64748b; font-size: 0.78rem; }

/* Ek Ödenekler — dinamik ekleme alanı */
.severance-calc .sev-allowances { margin: 1rem 0 1.25rem; padding: 18px; background: #fff; border: 1px dashed #303F9F40; border-radius: 12px; }
.severance-calc .sev-allowances-info { background: #FFF8E1; border: 1px solid #FFE082; border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; font-size: 0.88rem; color: #5d4037; line-height: 1.55; }
.severance-calc .sev-allowances-info strong { display: block; color: #303F9F; margin-bottom: 4px; }
.severance-calc .sev-allowances-info em { color: #303F9F; font-style: normal; font-weight: 600; }
.severance-calc #sev-allowances-list { display: flex; flex-direction: column; gap: 10px; }
.severance-calc .allowance-row { display: grid; grid-template-columns: 2fr 1fr 1.3fr 40px; gap: 10px; align-items: center; padding: 10px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; animation: allowanceFadeIn 0.25s ease; }
@keyframes allowanceFadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.severance-calc .allowance-row input, .severance-calc .allowance-row select { width: 100%; padding: 0.55rem 0.8rem; font-size: 0.93rem; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; height: 40px; font-family: inherit; }
.severance-calc .allowance-row .input-with-symbol { position: relative; }
.severance-calc .allowance-row .input-with-symbol .suffix { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: #64748b; font-weight: 600; pointer-events: none; }
.severance-calc .allowance-row .input-with-symbol input { padding-right: 26px; }
.severance-calc .allowance-remove { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; border-radius: 6px; width: 40px; height: 40px; cursor: pointer; transition: opacity 0.15s; display: flex; align-items: center; justify-content: center; }
.severance-calc .allowance-remove:hover { opacity: 0.75; }
.severance-calc .sev-allowances-add-wrapper { display: flex; justify-content: center; margin-top: 12px; }
.severance-calc .sev-allowance-add-btn { background: #303F9F; color: #fff; border: none; padding: 10px 22px; font-size: 0.95rem; font-weight: 700; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: opacity 0.15s; font-family: inherit; }
.severance-calc .sev-allowance-add-btn:hover { opacity: 0.85; }
.severance-calc .sev-allowance-add-btn i { font-size: 1.1rem; }

/* Sonuç dökümü tablosu */
.severance-calc .sev-breakdown { margin-top: 1rem; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
.severance-calc .sev-breakdown h4 { margin: 0; padding: 12px 16px; background: #f8fafc; font-size: 0.95rem; font-weight: 700; color: #303F9F; border-bottom: 1px solid #e2e8f0; }
.severance-calc .sev-breakdown-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; table-layout: fixed; }
.severance-calc .sev-breakdown-table colgroup col:nth-child(1) { width: 38%; }
.severance-calc .sev-breakdown-table colgroup col:nth-child(2) { width: 18%; }
.severance-calc .sev-breakdown-table colgroup col:nth-child(3) { width: 22%; }
.severance-calc .sev-breakdown-table colgroup col:nth-child(4) { width: 22%; }
.severance-calc .sev-breakdown-table th { padding: 10px 14px; font-weight: 700; background: #fafbfc; color: #475569; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.severance-calc .sev-breakdown-table td { padding: 10px 14px; border-top: 1px solid #f1f5f9; color: #334155; font-variant-numeric: tabular-nums; }
.severance-calc .sev-breakdown-table tfoot td { background: #f8fafc; border-top: 2px solid #e2e8f0; }
/* SOL: 1. ve 2. kolon (Açıklama, Periyot) — başlık + değer aynı hizada */
.severance-calc .sev-breakdown-table th:nth-child(1),
.severance-calc .sev-breakdown-table td:nth-child(1),
.severance-calc .sev-breakdown-table th:nth-child(2),
.severance-calc .sev-breakdown-table td:nth-child(2) { text-align: left; }
/* SAĞ: 3. ve 4. kolon (Tutar, Aylık Karşılığı) — başlık + değer aynı hizada */
.severance-calc .sev-breakdown-table th:nth-child(3),
.severance-calc .sev-breakdown-table td:nth-child(3),
.severance-calc .sev-breakdown-table th:nth-child(4),
.severance-calc .sev-breakdown-table td:nth-child(4) { text-align: right; }
/* tfoot: "Toplam Aylık Karşılık:" colspan=3 → label sağa, değer sağa (nth-child colspan'i saymıyor) */
.severance-calc .sev-breakdown-table tfoot td:first-child { text-align: right; }
.severance-calc .sev-breakdown-table tfoot td:last-child { text-align: right; }

@media (max-width: 768px) {
    .severance-calc .allowance-row { grid-template-columns: 1fr 1fr; gap: 8px; }
    .severance-calc .allowance-row > .input-with-symbol { grid-column: span 2; }
    .severance-calc .allowance-remove { grid-column: span 2; height: 36px; }
}
.severance-calc .calc-content-box { background: #fafafa; border: 1px solid #e5e7eb; border-radius: 8px; padding: 2rem 2.25rem; margin-top: 2rem; line-height: 1.7; color: #334155; }
.severance-calc .calc-content-box h2 { font-size: 1.5rem; font-weight: 700; color: var(--cat-bg, #303F9F); margin: 1.75rem 0 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid #e5e7eb; }
.severance-calc .calc-content-box h2:first-child { margin-top: 0; }
.severance-calc .calc-content-box h3 { font-size: 1.15rem; font-weight: 700; color: #1e293b; margin: 1.5rem 0 0.75rem; }
.severance-calc .calc-content-box p { margin: 0 0 1rem; }
.severance-calc .calc-content-box ul, .severance-calc .calc-content-box ol { margin: 0 0 1rem 1.5rem; }
.severance-calc .calc-content-box li { margin-bottom: 0.5rem; }
.severance-calc .calc-content-box code { background: #fff; border: 1px solid #e5e7eb; border-radius: 4px; padding: 0.15rem 0.4rem; font-family: inherit; font-size: 0.9em; color: #be185d; }
@media (max-width: 1024px) {
    .severance-calc .severance-row.calc-input-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .severance-calc .severance-row.calc-input-row { grid-template-columns: 1fr; gap: 1rem; }
    .severance-calc .severance-results.calc-results-grid, .severance-calc .severance-results-extra.calc-results-grid { grid-template-columns: 1fr; }
    .severance-calc .calc-content-box { padding: 1.5rem 1.25rem; }
}
