/* Geçmiş analizler modal — siddet-hesaplama */
.siddet-history-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 10002;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.siddet-history-modal.active {
    display: flex;
}

.siddet-history-modal-content {
    background: #fff;
    border-radius: 12px;
    width: min(calc(100vw - 24px), 960px);
    max-height: min(calc(100vh - 24px), 92vh);
    display: flex;
    flex-direction: column;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
    overflow: hidden;
}

.siddet-history-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.siddet-history-modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #344c64;
}

.siddet-history-modal-close {
    width: 34px;
    height: 34px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #64748b;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.siddet-history-modal-close:hover {
    background: #f1f5f9;
}

.siddet-history-filter-wrap {
    padding: 12px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.siddet-history-danisan-select {
    flex: 1 1 200px;
    min-width: 160px;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #344c64;
    background: #fff;
}

.siddet-history-date-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.siddet-history-progress {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #fafbfc;
}

.siddet-history-progress-title {
    margin: 0 0 4px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
}

.siddet-history-progress-summary {
    margin: 0 0 12px;
    font-size: 0.8rem;
    color: #64748b;
}

.siddet-history-progress-chart-wrap {
    height: 220px;
    position: relative;
}

.siddet-history-list-wrap {
    flex: 1;
    overflow: auto;
    padding: 8px 12px 16px;
    min-height: 180px;
}

.siddet-history-loading,
.siddet-history-empty {
    padding: 24px 16px;
    text-align: center;
    color: #64748b;
    font-size: 0.92rem;
}

.siddet-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.siddet-history-row {
    display: grid;
    grid-template-columns: minmax(90px, 1.1fr) minmax(120px, 2fr) minmax(110px, 1.2fr) auto;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fafbfc;
}

.siddet-history-danisan {
    font-weight: 600;
    color: #344c64;
    font-size: 0.88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.siddet-history-summary {
    color: #4a5f73;
    font-size: 0.84rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.siddet-history-date {
    color: #64748b;
    font-size: 0.8rem;
    white-space: nowrap;
}

.siddet-history-actions {
    display: flex;
    gap: 6px;
}

.siddet-history-view-btn,
.siddet-history-pdf-btn,
.siddet-history-delete-btn {
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
}

.siddet-history-view-btn:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #3730a3;
}

.siddet-history-pdf-btn:hover {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.siddet-history-delete-btn:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.siddet-history-pdf-btn:disabled,
.siddet-history-view-btn:disabled,
.siddet-history-delete-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

.pdf-card-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.pdf-card-actions-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pdf-card-actions-row .btn-outline,
.pdf-card-actions-row .btn-secondary-outline {
    flex: 1;
    min-width: 120px;
    justify-content: center;
}

.btn-secondary-outline {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.btn-secondary-outline:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.btn-secondary-outline.is-saved {
    border-color: #10b981;
    color: #047857;
    background: #ecfdf5;
}

.btn-secondary-outline:disabled,
.btn-secondary-outline.is-saved:disabled {
    cursor: default;
    opacity: 0.92;
}

.pdf-card-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.pdf-card-toolbar .btn-text-link {
    background: none;
    border: none;
    color: #577399;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.pdf-card-toolbar .btn-text-link:hover {
    color: #32435e;
}

@media (max-width: 640px) {
    .siddet-history-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .siddet-history-actions {
        justify-content: flex-end;
    }
}
