/* My RFQs Page Styles */
:root {
    --primary: #0B4F6C;
    --primary-dark: #083b4f;
    --primary-light: #1a6b8a;
    --secondary: #10B981;
    --accent: #F59E0B;
    --danger: #EF4444;
    --whatsapp: #25D366;
    --dark: #1F2937;
    --gray-800: #1F2937;
    --gray-700: #374151;
    --gray-600: #4B5563;
    --gray-500: #6B7280;
    --gray-400: #9CA3AF;
    --gray-300: #D1D5DB;
    --gray-200: #E5E7EB;
    --gray-100: #F3F4F6;
    --white: #FFFFFF;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.08);
    --radius: 12px;
    --radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-100);
    color: var(--dark);
    line-height: 1.5;
    padding-bottom: 80px;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
}

.back-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gray-100);
    border-radius: 50%;
    color: var(--gray-600);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.logo {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.logo-circle {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
    font-style: italic;
}

.logo-text {
    font-weight: 700;
    font-size: 18px;
    color: var(--primary);
}

.logo-text span {
    color: var(--primary);
}

.menu-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gray-100);
    border-radius: 50%;
    color: var(--gray-600);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Page Title */
.page-title {
    padding: 8px 16px 12px;
}

.page-title h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 2px;
}

.page-title p {
    font-size: 14px;
    color: var(--gray-500);
}

/* Quick Stats */
.quick-stats {
    display: flex;
    gap: 8px;
    padding: 8px 16px 16px;
    overflow-x: auto;
    scrollbar-width: none;
}

.quick-stats::-webkit-scrollbar {
    display: none;
}

.stat-item {
    flex: 0 0 auto;
    min-width: 70px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 30px;
    padding: 8px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.stat-item:active {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(0.95);
}

.stat-item:active .stat-value,
.stat-item:active .stat-label {
    color: white;
}

.stat-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 10px;
    color: var(--gray-500);
}

/* Search and Filter Bar */
.search-filter-bar {
    display: flex;
    gap: 8px;
    padding: 8px 16px 16px;
}

.search-box {
    flex: 1;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.search-box input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 1px solid var(--gray-300);
    border-radius: 30px;
    font-size: 14px;
    background: var(--white);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-btn {
    width: 46px;
    height: 46px;
    border: 1px solid var(--gray-300);
    border-radius: 50%;
    background: var(--white);
    color: var(--gray-600);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-btn:active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Filter Panel */
.filter-panel {
    background: var(--white);
    padding: 20px 16px;
    border-top: 1px solid var(--gray-200);
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-section {
    margin-bottom: 20px;
}

.filter-section h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--dark);
}

.filter-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.filter-select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--white);
}

.date-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.date-input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.filter-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.apply-btn, .reset-btn {
    flex: 1;
    padding: 12px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

.apply-btn {
    background: var(--primary);
    color: white;
}

.apply-btn:active {
    background: var(--primary-dark);
}

.reset-btn {
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.reset-btn:active {
    background: var(--gray-100);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    padding: 0 16px 16px;
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Main Content */
.main-content {
    padding: 0 16px 20px;
    max-width: 600px;
    margin: 0 auto;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 40px 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* RFQs List */
.rfqs-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* RFQ Card */
.rfq-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    transition: all 0.2s;
    cursor: pointer;
}

.rfq-card:active {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.rfq-card.pending { border-left: 4px solid var(--gray-500); }
.rfq-card.matching { border-left: 4px solid var(--accent); }
.rfq-card.sent { border-left: 4px solid var(--primary); }
.rfq-card.quoted { border-left: 4px solid var(--secondary); background: #F0FDF4; }
.rfq-card.expired { border-left: 4px solid var(--gray-400); opacity: 0.7; }
.rfq-card.cancelled { border-left: 4px solid var(--danger); opacity: 0.7; }

.rfq-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.rfq-title h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 2px;
}

.rfq-number {
    font-size: 11px;
    color: var(--gray-500);
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.status-badge.pending { background: var(--gray-200); color: var(--gray-700); }
.status-badge.matching { background: #FFF3E0; color: var(--accent); }
.status-badge.sent { background: #EFF6FF; color: var(--primary); }
.status-badge.quoted { background: #E7F5E8; color: var(--secondary); }
.status-badge.expired { background: var(--gray-200); color: var(--gray-600); }
.status-badge.cancelled { background: #FEE2E2; color: var(--danger); }

.rfq-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--gray-600);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-item i {
    color: var(--primary);
}

.contact-preference i {
    font-size: 14px;
}

.rfq-products {
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 12px;
}

.product-preview {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
    border-bottom: 1px dashed var(--gray-300);
}

.product-preview:last-child {
    border-bottom: none;
}

.product-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-qty {
    font-weight: 600;
    color: var(--primary);
}

.more-products {
    text-align: center;
    font-size: 11px;
    color: var(--gray-500);
    padding-top: 4px;
}

.rfq-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.supplier-stats {
    display: flex;
    gap: 16px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--gray-600);
}

.stat i {
    color: var(--primary);
}

.stat.has-quotes i {
    color: var(--secondary);
}

.rfq-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--gray-100);
    color: var(--gray-700);
}

.action-btn.quotes-btn {
    background: #E7F5E8;
    color: var(--secondary);
}

.action-btn.edit-btn:hover {
    background: var(--primary);
    color: white;
}

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

.action-btn.view-btn:hover {
    background: var(--accent);
    color: white;
}

.expiry-warning {
    margin-top: 12px;
    padding: 8px 12px;
    background: #FEE2E2;
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.empty-state i {
    font-size: 48px;
    color: var(--gray-300);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 24px;
}

.create-btn {
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Load More */
.load-more {
    text-align: center;
    margin-top: 20px;
}

.load-more-btn {
    padding: 14px 32px;
    background: var(--white);
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.load-more-btn:active {
    background: var(--primary);
    color: white;
}

/* Quick Action FAB */
.quick-action {
    position: fixed;
    bottom: 80px;
    right: 16px;
    z-index: 90;
}

.fab-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-lg);
    transition: all 0.2s;
}

.fab-btn:active {
    transform: scale(0.95);
    background: var(--primary-dark);
}

.fab-btn i {
    font-size: 18px;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    display: flex;
    padding: 8px 0 12px;
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--gray-400);
    font-size: 11px;
    gap: 4px;
}

.nav-item i {
    font-size: 20px;
}

.nav-item.active {
    color: var(--primary);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-500);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Detail Sections */
.detail-section {
    margin-bottom: 20px;
}

.detail-section h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--dark);
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 8px;
}

.detail-row {
    display: flex;
    margin-bottom: 8px;
    font-size: 14px;
}

.detail-label {
    width: 120px;
    color: var(--gray-500);
}

.detail-value {
    flex: 1;
    font-weight: 500;
}

/* Products List */
.products-list {
    max-height: 200px;
    overflow-y: auto;
}

.product-detail-item {
    padding: 8px;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.product-detail-name {
    font-weight: 600;
    font-size: 14px;
}

.product-detail-qty {
    font-size: 13px;
    color: var(--primary);
    margin: 2px 0;
}

.product-detail-specs {
    font-size: 12px;
    color: var(--gray-600);
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Quote Cards in Modal */
.quote-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.quote-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.quote-supplier {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.supplier-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
    overflow: hidden;
}

.supplier-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.supplier-info {
    flex: 1;
}

.supplier-info h4 {
    font-size: 15px;
    margin-bottom: 2px;
}

.quote-date {
    font-size: 11px;
    color: var(--gray-500);
}

.quote-amount {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.quote-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.quote-status.sent {
    background: #EFF6FF;
    color: var(--primary);
}

.quote-status.accepted {
    background: #E7F5E8;
    color: var(--secondary);
}

/* Cancel Modal */
.cancel-icon {
    text-align: center;
    margin-bottom: 20px;
}

.cancel-icon i {
    font-size: 48px;
    color: var(--danger);
}

.cancel-warning {
    color: var(--danger);
    font-size: 13px;
    margin-top: 8px;
    text-align: center;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-danger {
    padding: 12px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 100px;
    left: 16px;
    right: 16px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 14px 20px;
    border-radius: 30px;
    font-size: 14px;
    text-align: center;
    z-index: 2000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    max-width: 400px;
    margin: 0 auto;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--secondary);
}

.toast.error {
    background: var(--danger);
}

/* Responsive */
@media (max-width: 480px) {
    .filter-options {
        grid-template-columns: 1fr;
    }
    
    .rfq-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .rfq-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer button {
        width: 100%;
    }
    
    .detail-row {
        flex-direction: column;
    }
    
    .detail-label {
        width: 100%;
        margin-bottom: 2px;
    }
}