/**
 * Quote Management Dashboard Styles
 * Created: 2026-01-13 (Phase 5 - Quote builder feature parity)
 */

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

/* Header */
.dashboard-header {
    background: linear-gradient(135deg, #2e4a62 0%, #1a2f42 100%);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dashboard-header .logo {
    height: 40px;
    filter: brightness(0) invert(1);
}

.dashboard-header h1 {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.user-info {
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    padding-right: 12px;
    border-right: 1px solid rgba(255,255,255,0.3);
}

.btn-header {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-header:hover {
    background: rgba(255,255,255,0.25);
}

/* Main Container */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* Filters Section */
.filters-section {
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group select,
.filter-group input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
}

.filter-group input[type="text"] {
    min-width: 250px;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #2e4a62;
    box-shadow: 0 0 0 2px rgba(46,74,98,0.1);
}

.btn-search {
    background: #2e4a62;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    align-self: flex-end;
}

.btn-search:hover {
    background: #1a2f42;
}

/* Stats Cards */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    text-align: center;
}

.stat-card.active {
    border-left: 4px solid #28a745;
}

.stat-card.accepted {
    border-left: 4px solid #2e4a62;
}

.stat-card.expiring {
    border-left: 4px solid #ffc107;
}

.stat-card.total {
    border-left: 4px solid #17a2b8;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Quote Table */
.quotes-table-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    overflow: hidden;
}

.table-header {
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.table-count {
    font-size: 13px;
    color: #666;
}

.quotes-table {
    width: 100%;
    border-collapse: collapse;
}

.quotes-table th {
    background: #f8f9fa;
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #eee;
}

.quotes-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.quotes-table tbody tr {
    cursor: pointer;
    transition: background 0.15s;
}

.quotes-table tbody tr:hover {
    background: #f8f9fa;
}

.quote-id {
    font-weight: 600;
    color: #2e4a62;
}

.customer-name {
    font-weight: 500;
}

.customer-email {
    font-size: 12px;
    color: #888;
}

.quote-amount {
    font-weight: 600;
    text-align: right;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.accepted {
    background: #d1e7f0;
    color: #0c5460;
}

.status-badge.expired {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.expiring-soon {
    background: #fff3cd;
    color: #856404;
}

/* Created/Expires Date */
.date-cell {
    font-size: 13px;
    color: #666;
}

.date-relative {
    font-size: 11px;
    color: #999;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.empty-state i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 16px;
}

.empty-state h3 {
    margin: 0 0 8px;
    font-size: 18px;
    color: #666;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
}

/* Loading State */
.loading-overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2e4a62;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Actions Column */
.action-btn {
    background: none;
    border: none;
    color: #2e4a62;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    transition: background 0.15s;
}

.action-btn:hover {
    background: #e8f0f6;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid #eee;
}

.pagination button {
    background: white;
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}

.pagination button:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #2e4a62;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .page-info {
    font-size: 13px;
    color: #666;
    padding: 0 12px;
}

/* Status Dropdown */
.status-dropdown {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    min-width: 100px;
}

.status-dropdown:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(46,74,98,0.2);
}

.status-dropdown.status-open {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.status-dropdown.status-accepted {
    background: #d1e7f0;
    border-color: #17a2b8;
    color: #0c5460;
}

.status-dropdown.status-lost {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.status-dropdown.status-expired {
    background: #e2e3e5;
    border-color: #6c757d;
    color: #383d41;
}

/* Status badge for Open */
.status-badge.open {
    background: #d4edda;
    color: #155724;
}

/* Status badge for Lost */
.status-badge.lost {
    background: #f8d7da;
    color: #721c24;
}

/* Checkbox Column */
.checkbox-col {
    width: 40px;
    text-align: center;
}

.quote-checkbox {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

/* Table Actions */
.table-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Bulk Delete Button */
.btn-bulk-delete {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-bulk-delete:hover:not(:disabled) {
    background: #c82333;
}

.btn-bulk-delete:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Audit Action Button */
.action-audit {
    color: #7c3aed;
}

.action-audit:hover {
    background: #ede9fe;
}

/* Delete Action Button */
.action-delete {
    color: #dc3545;
}

.action-delete:hover {
    background: #dc3545;
    color: white;
}

/* Delete Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 8px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-content h3 {
    margin: 0 0 16px;
    font-size: 18px;
    color: #333;
}

.modal-content p {
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-cancel {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: #e9ecef;
}

.btn-confirm-delete {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-confirm-delete:hover:not(:disabled) {
    background: #c82333;
}

.btn-confirm-delete:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Warning text in modal */
.warning-text {
    color: #dc3545;
    font-weight: 600;
}

.warning-text i {
    margin-right: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 16px;
    }

    .filters-section {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group select,
    .filter-group input {
        min-width: unset;
        width: 100%;
    }

    .stats-section {
        grid-template-columns: repeat(2, 1fr);
    }

    .quotes-table {
        display: block;
        overflow-x: auto;
    }

    .dashboard-header h1 {
        display: none;
    }

    .table-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .table-actions {
        width: 100%;
        justify-content: space-between;
    }

    .btn-bulk-delete {
        font-size: 12px;
        padding: 6px 12px;
    }

    .checkbox-col {
        width: 32px;
    }

    .modal-content {
        margin: 16px;
    }
}
