/* ==========================================
   QUOTE GENERATION STEP
   Matching MenuInventoryStep Style
   ========================================== */

/* Container & Layout */
.qgs-container {
    margin: 0 auto;
    padding: 1rem;
}

.qgs-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.qgs-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.qgs-header-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

/* Section Cards */
.qgs-section-card {
    background: white;
    border-radius: 0.625rem;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.25rem;
    border: 1px solid #e5e7eb;
}

.qgs-quotes-section {
    background: white;
    border-radius: 0.625rem;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.25rem;
    border: 1px solid #e5e7eb;
}

.qgs-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.qgs-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

/* Quote Cards */
.qgs-quote-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.875rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 0.75rem;
    transition: all 0.2s;
}

.qgs-quote-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.qgs-quote-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.qgs-quote-info h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.25rem 0;
}

.qgs-quote-date {
    font-size: 0.6875rem;
    color: #6b7280;
}

/* Quote Card Layout */
.qgs-card-latest {
    border-left: 4px solid #10b981;
    background: #f0fdf4;
}

.qgs-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.875rem;
    gap: 1rem;
}

.qgs-card-header-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.qgs-card-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.qgs-card-quote-number {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.qgs-card-quote-number strong {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
}

.qgs-card-invoice-number {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: #6b7280;
}

.qgs-card-invoice-number i {
    color: #3b82f6;
}

.qgs-badge {
    padding: 0.1875rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.qgs-badge-success {
    background: #d1fae5;
    color: #065f46;
}

.qgs-btn-expand {
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 1.125rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qgs-btn-expand:hover {
    color: #111827;
    background: #f3f4f6;
    border-radius: 0.25rem;
}

/* Card Body */
.qgs-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.qgs-card-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.qgs-card-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.625rem 0.75rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
}

.qgs-card-info-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.qgs-card-info-value {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #111827;
}

.qgs-card-total {
    color: #3b82f6;
    font-size: 1.125rem;
}

.qgs-text-success {
    color: #10b981;
}

.qgs-outstanding-amount {
    color: #f59e0b;
}

/* Payment Status */
.qgs-card-payment-status {
    display: flex;
    justify-content: center;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 0.375rem;
    border: 1px solid #e5e7eb;
}

.qgs-payment-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.qgs-payment-indicator i {
    font-size: 1.125rem;
}

.qgs-payment-indicator.qgs-paid {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.qgs-payment-indicator.qgs-partial {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.qgs-payment-indicator.qgs-pending {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.qgs-payment-indicator.qgs-draft {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.qgs-payment-indicator.qgs-declined {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* Card Actions */
.qgs-card-actions {
    display: flex;
    gap: 0.625rem;
    padding-top: 0.875rem;
    border-top: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.qgs-card-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    min-width: 100px;
}

.qgs-card-action-btn i {
    font-size: 0.9375rem;
}

.qgs-card-action-btn.qgs-btn-primary {
    background: #3b82f6;
    color: white;
}

.qgs-card-action-btn.qgs-btn-primary:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
}

.qgs-card-action-btn.qgs-btn-info {
    background: #0891b2;
    color: white;
}

.qgs-card-action-btn.qgs-btn-info:hover:not(:disabled) {
    background: #0e7490;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(8, 145, 178, 0.2);
}

.qgs-card-action-btn.qgs-btn-secondary {
    background: white;
    color: #6b7280;
    border-color: #d1d5db;
}

.qgs-card-action-btn.qgs-btn-secondary:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
}

.qgs-card-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Card Details (Expanded) */
.qgs-card-details {
    padding-top: 0.875rem;
    margin-top: 0.875rem;
    border-top: 2px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.qgs-card-details-section {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.qgs-card-details-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.qgs-card-details-title i {
    color: #3b82f6;
    font-size: 1.125rem;
}

/* Quote Details Grid */
.qgs-card-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

.qgs-card-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.625rem 0.75rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
}

.qgs-card-detail-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.qgs-card-detail-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
}

/* Financial Summary */
.qgs-card-financial-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 0.875rem;
}

.qgs-card-financial-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #374151;
    padding: 0.375rem 0;
}

.qgs-card-financial-item span:last-child {
    font-weight: 600;
    color: #111827;
}

.qgs-card-financial-total {
    padding-top: 0.625rem;
    margin-top: 0.5rem;
    border-top: 2px solid #d1d5db;
    font-size: 1rem;
    font-weight: 700;
}

.qgs-card-financial-total span {
    color: #3b82f6;
    font-weight: 700;
}

/* Payment History */
.qgs-card-payments-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.qgs-card-payment-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.qgs-card-payment-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.qgs-card-payment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.qgs-card-payment-number {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #6b7280;
    font-family: monospace;
}

.qgs-card-payment-amount {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
}

.qgs-card-payment-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: #6b7280;
    align-items: center;
}

.qgs-payment-type-badge {
    padding: 0.1875rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.qgs-payment-type-standard {
    background: #dbeafe;
    color: #1e40af;
}

.qgs-payment-type-deposit {
    background: #fef3c7;
    color: #92400e;
}

.qgs-payment-type-balance {
    background: #d1fae5;
    color: #065f46;
}

.qgs-card-payment-reverse {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: white;
    color: #dc2626;
    border: 1px solid #dc2626;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.25rem;
}

.qgs-card-payment-reverse:hover:not(:disabled) {
    background: #dc2626;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.qgs-card-payment-reverse:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qgs-card-payment-reverse i {
    font-size: 0.8125rem;
}

/* Status Badges */
.qgs-status-badge {
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.qgs-status-draft {
    background: #f3f4f6;
    color: #6b7280;
}

.qgs-status-pending {
    background: #fef3c7;
    color: #92400e;
}

.qgs-status-accepted {
    background: #dbeafe;
    color: #1e40af;
}

.qgs-status-confirmed {
    background: #dbeafe;
    color: #1e40af;
}

.qgs-status-paid {
    background: #d1fae5;
    color: #065f46;
}

.qgs-status-rejected,
.qgs-status-declined {
    background: #fee2e2;
    color: #991b1b;
}

/* Quote Details Grid */
.qgs-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.875rem;
    margin-bottom: 0.875rem;
}

.qgs-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.qgs-detail-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.qgs-detail-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #111827;
}

/* Line Items Table */
.qgs-table-wrapper {
    overflow-x: auto;
    margin: -0.25rem;
    padding: 0.25rem;
}

.qgs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.qgs-table th {
    padding: 0.5rem 0.625rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.qgs-table td {
    padding: 0.5rem 0.625rem;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.qgs-table tbody tr:last-child td {
    border-bottom: none;
}

.qgs-table tbody tr:hover {
    background: #f9fafb;
}

.qgs-table tfoot td {
    padding: 0.625rem;
    background: #f9fafb;
    border-top: 2px solid #e5e7eb;
    font-weight: 600;
}

.qgs-text-right {
    text-align: right !important;
}

/* Total Section */
.qgs-total-section {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.875rem;
    margin-top: 0.875rem;
}

.qgs-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.375rem 0;
    font-size: 0.875rem;
}

.qgs-total-row span {
    color: #6b7280;
}

.qgs-total-row strong {
    font-weight: 600;
    color: #111827;
}

.qgs-total-row.qgs-grand-total {
    padding-top: 0.625rem;
    border-top: 2px solid #d1d5db;
    margin-top: 0.5rem;
    font-size: 1rem;
}

.qgs-grand-total span,
.qgs-grand-total strong {
    font-weight: 700;
    color: #3b82f6;
    font-size: 1.125rem;
}

/* Buttons */
.qgs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.qgs-btn-primary {
    background: #3b82f6;
    color: white;
}

.qgs-btn-primary:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-1px);
}

.qgs-btn-secondary {
    background: white;
    color: #6b7280;
    border-color: #d1d5db;
}

.qgs-btn-secondary:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #9ca3af;
}

.qgs-btn-success {
    background: #10b981;
    color: white;
}

.qgs-btn-success:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-1px);
}

.qgs-btn-danger {
    background: #dc2626;
    color: white;
}

.qgs-btn-danger:hover:not(:disabled) {
    background: #b91c1c;
    transform: translateY(-1px);
}

.qgs-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Actions Bar */
.qgs-actions {
    display: flex;
    gap: 0.625rem;
    flex-wrap: wrap;
}

.qgs-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

/* Empty State */
.qgs-empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: #6b7280;
}

.qgs-empty-state > i {
    font-size: 3rem;
    color: #d1d5db;
    margin-bottom: 0.875rem;
}

.qgs-empty-state p {
    margin: 0.375rem 0;
    font-size: 0.9375rem;
}

/* Form Elements */
.qgs-form-group {
    margin-bottom: 0.875rem;
}

.qgs-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    display: block;
    margin-bottom: 0.375rem;
}

.qgs-input,
.qgs-select,
.qgs-textarea {
    width: 100%;
    padding: 0.5rem 0.625rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: #111827;
    background: white;
    transition: all 0.2s;
}

.qgs-input:focus,
.qgs-select:focus,
.qgs-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.qgs-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Banners */
.qgs-package-banner {
    background: #dbeafe;
    border: 1px solid #3b82f6;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.qgs-package-banner i {
    color: #3b82f6;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.qgs-package-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.qgs-package-info strong {
    font-size: 0.8125rem;
    color: #1e40af;
}

.qgs-package-price {
    font-size: 0.875rem;
    color: #1e40af;
    font-weight: 600;
}

.qgs-uninvoiced-banner {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.qgs-uninvoiced-banner i {
    color: #f59e0b;
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.qgs-uninvoiced-info {
    flex: 1;
}

.qgs-uninvoiced-info strong {
    font-size: 0.8125rem;
    color: #92400e;
    display: block;
    margin-bottom: 0.25rem;
}

.qgs-uninvoiced-hint {
    font-size: 0.75rem;
    color: #78350f;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.qgs-uninvoiced-hint i {
    font-size: 0.875rem;
}

/* Modal/Dialog */
.qgs-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
}

.qgs-modal {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.qgs-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    border-bottom: 2px solid #e5e7eb;
    background: #f9fafb;
}

.qgs-modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

.qgs-modal-body {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
}

.qgs-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.625rem;
    padding: 0.875rem 1rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

/* Responsive */
@media (max-width: 768px) {
    .qgs-container {
        padding: 0.75rem;
    }

    .qgs-header {
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }

    .qgs-header h2 {
        font-size: 1.25rem;
    }

    .qgs-section-card,
    .qgs-quotes-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .qgs-section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .qgs-quote-card {
        padding: 0.75rem;
    }

    .qgs-card-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .qgs-card-header-right {
        width: 100%;
        justify-content: space-between;
    }

    .qgs-card-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .qgs-card-actions {
        flex-direction: column;
    }

    .qgs-card-action-btn {
        width: 100%;
    }

    .qgs-card-details-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .qgs-details-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .qgs-table {
        font-size: 0.8125rem;
    }

    .qgs-table th,
    .qgs-table td {
        padding: 0.375rem 0.5rem;
    }

    .qgs-actions {
        flex-direction: column;
    }

    .qgs-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .qgs-details-grid {
        grid-template-columns: 1fr;
    }

    .qgs-card-info-grid {
        grid-template-columns: 1fr;
    }

    .qgs-card-details-grid {
        grid-template-columns: 1fr;
    }
}
