/**
 * Perfex CRM - Client Area Styles
 */

/* Proposal View */
.proposal-view {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.proposal-header {
    text-align: center;
    padding: 30px 0;
    border-bottom: 2px solid #007bff;
    margin-bottom: 30px;
}

.proposal-header h1 {
    font-size: 28px;
    margin-bottom: 10px;
    color: #333;
}

.proposal-header h2 {
    font-size: 20px;
    color: #007bff;
}

.proposal-info-box {
    border: 1px solid #dee2e6;
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
    background-color: #f8f9fa;
}

.proposal-items-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.proposal-items-table th,
.proposal-items-table td {
    border: 1px solid #dee2e6;
    padding: 12px;
    text-align: left;
}

.proposal-items-table th {
    background-color: #007bff;
    color: white;
    font-weight: bold;
}

.proposal-items-table tbody tr:hover {
    background-color: #f8f9fa;
}

.proposal-totals {
    text-align: right;
    margin-top: 20px;
    font-size: 16px;
}

.proposal-totals .total-row {
    padding: 5px 0;
}

.proposal-totals .grand-total {
    font-size: 24px;
    font-weight: bold;
    color: #28a745;
    padding-top: 10px;
    border-top: 2px solid #333;
    margin-top: 10px;
}

/* Action Buttons */
.proposal-actions {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 4px;
    text-align: center;
}

.btn-accept {
    background-color: #28a745;
    color: white;
    padding: 12px 30px;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 0 5px;
    transition: background-color 0.2s;
}

.btn-accept:hover {
    background-color: #218838;
}

.btn-reject {
    background-color: #dc3545;
    color: white;
    padding: 12px 30px;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 0 5px;
    transition: background-color 0.2s;
}

.btn-reject:hover {
    background-color: #c82333;
}

.btn-download {
    background-color: #007bff;
    color: white;
    padding: 12px 30px;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 0 5px;
    transition: background-color 0.2s;
}

.btn-download:hover {
    background-color: #0056b3;
}

/* Signature Interface */
.signature-section {
    margin-top: 30px;
    padding: 20px;
    border: 2px solid #007bff;
    border-radius: 4px;
    background-color: #f8f9fa;
}

.signature-section h3 {
    color: #007bff;
    margin-bottom: 15px;
}

.signature-tabs {
    display: flex;
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 20px;
}

.signature-tab {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background-color: transparent;
    font-size: 16px;
    color: #6c757d;
    transition: color 0.2s, border-bottom 0.2s;
}

.signature-tab.active {
    color: #007bff;
    border-bottom: 3px solid #007bff;
}

.signature-canvas-container {
    border: 2px dashed #dee2e6;
    border-radius: 4px;
    padding: 10px;
    background-color: white;
    margin: 20px 0;
}

.signature-canvas {
    width: 100%;
    height: 200px;
    border: 1px solid #dee2e6;
    cursor: crosshair;
}

.signature-typed-input {
    width: 100%;
    font-size: 32px;
    font-family: 'Brush Script MT', cursive;
    padding: 15px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
}

.signature-agreement {
    margin: 20px 0;
}

.signature-agreement label {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.signature-agreement input[type="checkbox"] {
    margin-right: 10px;
    width: 20px;
    height: 20px;
}

/* Status Messages */
.proposal-status-message {
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
    text-align: center;
}

.proposal-status-message.accepted {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.proposal-status-message.rejected {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.proposal-status-message.expired {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

/* Responsive Design */
@media (max-width: 768px) {
    .proposal-view {
        padding: 10px;
    }
    
    .proposal-items-table {
        font-size: 12px;
    }
    
    .proposal-actions {
        display: flex;
        flex-direction: column;
    }
    
    .btn-accept,
    .btn-reject,
    .btn-download {
        width: 100%;
        margin: 5px 0;
    }
}

/* ==========================================================================
   Active Products/Services panel – "Aus angenommenen Angeboten" footer
   Modern, compact, theme-agnostic (matches products section style)
   ========================================================================== */
/* Allow expanded content to push layout (no clipping); stack above adjacent panels */
.perfex-accepted-offers-footer {
    position: relative;
    z-index: 2;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    padding: 0;
    margin: 0;
    overflow: visible;
}

/* Prevent parent panel/list from clipping when "show more" is expanded */
.panel-footer:has(.perfex-accepted-offers-footer),
.panel:has(.perfex-accepted-offers-footer) .list-group.has-scroll {
    overflow: visible !important;
}
.panel:has(.perfex-accepted-offers-footer) {
    overflow: visible !important;
}

/* Main section label – clear section title, not a row */
.perfex-accepted-offers-footer .perfex-offers-main-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b7280;
    padding: 12px 16px 8px;
    margin: 0;
    border: none;
    background: transparent;
    line-height: 1.2;
}

/* Each offer block – card-like, same feel as product rows */
.perfex-accepted-offers-footer .perfex-accepted-offers-section {
    margin: 0 0 0 0;
    border-bottom: 1px solid #e5e7eb;
}

.perfex-accepted-offers-footer .perfex-accepted-offers-section:last-child {
    border-bottom: none;
}

/* Offer group header (EST-000008/02/2026) – like product title row */
.perfex-accepted-offers-footer .perfex-offer-group-title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    padding: 10px 16px;
    background: #f9fafb;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    margin: 0;
    line-height: 1.35;
}

/* Single item row – compact, modern (no price; quantity × unit) */
.perfex-accepted-offers-footer .perfex-offer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 16px 8px 20px;
    font-size: 13px;
    color: #4b5563;
    background: #fff;
    border: none;
    border-bottom: 1px solid #f3f4f6;
    min-height: 0;
    line-height: 1.4;
}

.perfex-accepted-offers-footer .perfex-offer-item:last-of-type {
    border-bottom: none;
}

.perfex-accepted-offers-footer .perfex-offer-item-desc {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.perfex-accepted-offers-footer .perfex-offer-item-qty-unit {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 12px;
    color: #6b7280;
}

/* "… N weitere Positionen" */
.perfex-accepted-offers-footer .perfex-offer-more-items {
    font-size: 12px;
    color: #9ca3af;
    padding: 6px 16px 6px 20px;
    background: #fff;
    border: none;
    border-bottom: 1px solid #f3f4f6;
}

/* Paginated Angebote – one page visible at a time */
.perfex-accepted-offers-footer .perfex-offers-pages-wrap {
    position: relative;
    z-index: 1;
    background: #fff;
}

/* Pager for extra Angebote pages */
.perfex-accepted-offers-footer .perfex-offers-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 16px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    font-size: 13px;
}

.perfex-accepted-offers-footer .perfex-offers-pager-prev,
.perfex-accepted-offers-footer .perfex-offers-pager-next,
.perfex-accepted-offers-footer .perfex-offers-pager-close {
    color: #374151;
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 4px;
}

.perfex-accepted-offers-footer .perfex-offers-pager-prev:hover,
.perfex-accepted-offers-footer .perfex-offers-pager-next:hover {
    background: #e5e7eb;
}

.perfex-accepted-offers-footer .perfex-offers-pager-info {
    color: #6b7280;
}
