/* 견적관리 페이지 스타일 - 최신 트렌드 */

.quotes-content {
    padding: 2rem;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    min-height: calc(100vh - var(--header-height));
}

/* 상태 통계 카드 */
.status-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.status-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--gray-100);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.status-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gray-400);
}

.status-card.draft::before { background: linear-gradient(180deg, #94a3b8 0%, #cbd5e1 100%); }
.status-card.sent::before { background: linear-gradient(180deg, #3b82f6 0%, #60a5fa 100%); }
.status-card.accepted::before { background: linear-gradient(180deg, #10b981 0%, #34d399 100%); }
.status-card.rejected::before { background: linear-gradient(180deg, #ef4444 0%, #f87171 100%); }
.status-card.expired::before { background: linear-gradient(180deg, #f59e0b 0%, #fbbf24 100%); }

.status-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.status-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-50);
    border-radius: 12px;
}

.status-info {
    flex: 1;
}

.status-count {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1;
}

.status-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* 필터 바 */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.search-box {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 0.9375rem;
    background: var(--gray-50);
    transition: all 0.3s;
}

.search-input:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
}

.filter-group {
    display: flex;
    gap: 0.75rem;
}

.filter-select {
    padding: 0.625rem 2rem 0.625rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    background: white;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-select:hover {
    border-color: var(--gray-300);
}

.filter-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* 견적 목록 */
.quotes-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.quote-item {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--gray-100);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.quote-item:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.quote-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    padding: 1.5rem;
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    border-bottom: 1px solid var(--gray-100);
}

.quote-info {
    flex: 1;
}

.quote-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.quote-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.quote-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.quote-number {
    font-weight: 600;
    color: var(--primary);
}

.quote-status {
    text-align: right;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.status-badge.draft {
    background: var(--gray-100);
    color: var(--gray-600);
}

.status-badge.sent {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.status-badge.accepted {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-badge.rejected {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.status-badge.expired {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.quote-amount {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gray-900);
}

/* 견적 바디 */
.quote-body {
    padding: 1.25rem 1.5rem;
}

.quote-items {
    margin-bottom: 1rem;
}

.item-summary {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.item-summary span {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* 타임라인 */
.quote-timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
    padding: 1rem 0;
}

.quote-timeline::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 20px;
    right: 20px;
    height: 2px;
    background: var(--gray-200);
    transform: translateY(-50%);
    z-index: 0;
}

.timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    position: relative;
    z-index: 1;
}

.timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gray-300);
    border: 3px solid white;
    box-shadow: 0 0 0 1px var(--gray-200);
}

.timeline-item.completed .timeline-dot {
    background: var(--success);
    box-shadow: 0 0 0 1px var(--success);
}

.timeline-item.pending .timeline-dot {
    background: var(--warning);
    box-shadow: 0 0 0 1px var(--warning);
}

.timeline-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-700);
}

.timeline-date {
    font-size: 0.6875rem;
    color: var(--gray-500);
}

/* 견적 액션 */
.quote-actions {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-1px);
}

.action-btn.danger:hover {
    background: var(--danger);
    border-color: var(--danger);
}

/* 모달 */
.modal-fullscreen {
    width: 95%;
    max-width: 1400px;
    height: 90vh;
}

.modal-header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.quote-editor {
    padding: 2rem;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

.editor-section {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--gray-200);
}

.editor-section h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--gray-100);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--gray-100);
}

.section-header h3 {
    margin: 0;
    padding: 0;
    border: none;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.form-row:last-child {
    margin-bottom: 0;
}

.flex-2 {
    grid-column: span 2;
}

/* 견적 항목 테이블 */
.quote-items-table {
    overflow-x: auto;
    margin: 1.5rem 0;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
}

.items-table thead {
    background: var(--gray-50);
}

.items-table th {
    padding: 0.75rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--gray-200);
}

.items-table td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--gray-100);
}

.item-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.item-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.btn-remove {
    background: var(--danger);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-remove:hover {
    background: var(--danger);
    transform: scale(1.1);
}

/* 견적 요약 */
.quote-summary {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
    border: 1px solid var(--gray-200);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.summary-row:not(:last-child) {
    border-bottom: 1px solid var(--gray-200);
}

.summary-row.total {
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 2px solid var(--primary);
}

.summary-label {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.summary-row.total .summary-label {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
}

.summary-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
}

.summary-value.discount {
    color: var(--danger);
}

.summary-row.total .summary-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

/* 견적서 미리보기 */
.quote-preview {
    background: white;
    padding: 3rem;
    max-height: calc(90vh - 120px);
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* 애니메이션 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quote-item {
    animation: slideIn 0.3s ease-out;
}

/* 반응형 */
@media (max-width: 1200px) {
    .filter-bar {
        flex-direction: column;
    }

    .search-box {
        width: 100%;
    }

    .filter-group {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    .quotes-content {
        padding: 1rem;
    }

    .status-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .quote-header {
        flex-direction: column;
        gap: 1rem;
    }

    .quote-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .quote-actions {
        flex-wrap: wrap;
    }

    .action-btn {
        min-width: calc(50% - 0.25rem);
    }

    .modal-fullscreen {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }
}