* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
            background: #fafafa;
            color: #333;
        }

        .header {
            background: white;
            border-bottom: 1px solid #e0e0e0;
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .header-content {
            max-width: 1400px;
            margin: 0 auto;
            padding: 1rem 1.5rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 1rem;
        }

        .logo-img {
            height: 35px;
            width: auto;
            display: block;
        }


        .header-title h1 {
            font-size: 1.5rem;
            font-weight: 600;
            color: #333;
            margin-bottom: 0.25rem;
        }

        .header-title p {
            font-size: 0.875rem;
            color: #666;
        }

        .header-actions {
            display: flex;
            align-items: center;
            gap: 1rem;
            flex-wrap: wrap;
        }

        .exchange-rate-control {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 1rem;
            background: #f5f5f5;
            border-radius: 0.5rem;
        }

        .exchange-rate-label {
            font-size: 0.875rem;
            color: #666;
            font-weight: 500;
        }

        .exchange-rate-input {
            width: 80px;
            padding: 0.25rem 0.5rem;
            border: 1px solid #ddd;
            border-radius: 0.375rem;
            text-align: center;
            font-size: 0.875rem;
        }

        .fetch-rate-btn {
            padding: 0.25rem 0.75rem;
            background: #333;
            color: white;
            border: none;
            border-radius: 0.375rem;
            font-size: 0.75rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .fetch-rate-btn:hover {
            background: #555;
        }

        .toggle-group {
            display: flex;
            align-items: center;
            gap: 0.25rem;
            background: #f5f5f5;
            border-radius: 0.5rem;
            padding: 0.25rem;
        }

        .toggle-btn {
            padding: 0.5rem 1rem;
            border: none;
            border-radius: 0.375rem;
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            background: transparent;
            color: #666;
        }

        .toggle-btn:hover {
            color: #333;
        }

        .toggle-btn.active {
            background: white;
            color: #333;
            box-shadow: 0 1px 2px rgba(0,0,0,0.05);
        }

        .export-btn {
            padding: 0.625rem 1.5rem;
            background: #333;
            color: white;
            border: none;
            border-radius: 0.5rem;
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            box-shadow: 0 1px 2px rgba(0,0,0,0.05);
        }

        .export-btn:hover {
            background: #555;
        }

        .export-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .container {
            max-width: 1400px;
            margin: 2rem auto;
            padding: 0 1.5rem;
        }

        .grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 2rem;
        }

        @media (max-width: 1024px) {
            .grid {
                grid-template-columns: 1fr;
            }
        }

        .panel-title {
            font-size: 1.125rem;
            font-weight: 600;
            color: #333;
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .toggle-products-btn {
            padding: 0.375rem 0.75rem;
            background: #f5f5f5;
            color: #666;
            border: 1px solid #ddd;
            border-radius: 0.375rem;
            font-size: 0.75rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }

        .toggle-products-btn:hover {
            background: #e0e0e0;
            color: #333;
        }

        .add-custom-btn {
            width: 100%;
            padding: 0.75rem;
            background: #333;
            color: white;
            border: none;
            border-radius: 0.5rem;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            margin-bottom: 1rem;
        }

        .add-custom-btn:hover {
            background: #555;
        }

        .import-products-btn {
            width: 100%;
            padding: 0.75rem;
            background: #333;
            color: white;
            border: none;
            border-radius: 0.5rem;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            margin-bottom: 1rem;
        }

        .import-products-btn:hover {
            background: #555;
        }

        .products-panel {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .search-input {
            width: 100%;
            padding: 0.75rem 1rem;
            border: 1px solid #ddd;
            border-radius: 0.5rem;
            font-size: 0.9375rem;
            transition: all 0.2s;
        }

        .search-input:focus {
            outline: none;
            border-color: #333;
            box-shadow: 0 0 0 3px rgba(51, 51, 51, 0.1);
        }

        .search-input::placeholder {
            color: #999;
        }

        .product-card {
            background: white;
            border: 1px solid #e0e0e0;
            border-radius: 0.5rem;
            padding: 1.25rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .product-card:hover {
            border-color: #999;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        }

        .product-header {
            display: flex;
            align-items: start;
            justify-content: space-between;
            margin-bottom: 0.5rem;
        }

        .category-tag {
            display: inline-block;
            background: #f5f5f5;
            color: #666;
            font-size: 0.75rem;
            font-weight: 500;
            padding: 0.25rem 0.625rem;
            border-radius: 0.375rem;
            margin-bottom: 0.5rem;
        }

        .product-name {
            font-size: 1rem;
            font-weight: 600;
            color: #333;
            margin-bottom: 0.375rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            flex-wrap: wrap;
        }

        .imported-badge {
            display: inline-block;
            background: #e3f2fd;
            color: #1976d2;
            font-size: 0.625rem;
            font-weight: 600;
            padding: 0.125rem 0.5rem;
            border-radius: 0.25rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .persistent-badge {
            display: inline-block;
            background: #f3e5f5;
            color: #7b1fa2;
            font-size: 0.625rem;
            font-weight: 600;
            padding: 0.125rem 0.5rem;
            border-radius: 0.25rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .product-internal-notes {
            font-size: 0.8125rem;
            color: #1976d2;
            background: #e3f2fd;
            padding: 0.5rem;
            border-radius: 0.375rem;
            margin-top: 0.5rem;
            line-height: 1.4;
        }

        .product-meta {
            font-size: 0.75rem;
            color: #999;
            margin-top: 0.25rem;
        }

        .product-description {
            font-size: 0.875rem;
            color: #666;
            line-height: 1.5;
            margin-bottom: 0.75rem;
        }

        .product-cost {
            font-size: 0.875rem;
            color: #333;
            font-weight: 500;
        }

        .add-btn {
            padding: 0.5rem 1rem;
            background: #333;
            color: white;
            border: none;
            border-radius: 0.375rem;
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }

        .add-btn:hover {
            background: #555;
        }

        .quote-panel {
            background: white;
            border: 1px solid #e0e0e0;
            border-radius: 0.5rem;
            min-height: 400px;
        }

        .quote-tabs {
            display: flex;
            border-bottom: 1px solid #e0e0e0;
        }

        .quote-tab {
            flex: 1;
            padding: 1rem;
            background: transparent;
            border: none;
            font-size: 0.875rem;
            font-weight: 500;
            color: #666;
            cursor: pointer;
            transition: all 0.2s;
            border-bottom: 2px solid transparent;
        }

        .quote-tab:hover {
            color: #333;
        }

        .quote-tab.active {
            color: #333;
            border-bottom-color: #333;
        }

        .quote-content {
            padding: 1.5rem;
        }

        .empty-state {
            text-align: center;
            padding: 3rem 1rem;
        }

        .empty-icon {
            font-size: 3rem;
            margin-bottom: 1rem;
        }

        .empty-title {
            font-size: 1.125rem;
            font-weight: 600;
            color: #333;
            margin-bottom: 0.5rem;
        }

        .empty-text {
            font-size: 0.875rem;
            color: #666;
        }

        .quote-item {
            background: #fafafa;
            border: 1px solid #e0e0e0;
            border-radius: 0.5rem;
            padding: 1rem;
            margin-bottom: 0.75rem;
        }

        .quote-item-header {
            display: flex;
            align-items: start;
            justify-content: space-between;
            margin-bottom: 0.75rem;
        }

        .quote-item-name {
            font-size: 0.9375rem;
            font-weight: 600;
            color: #333;
            margin-bottom: 0.25rem;
        }

        .quote-item-category {
            font-size: 0.8125rem;
            color: #666;
        }

        .quote-item-cost {
            text-align: right;
        }

        .quote-item-cost-primary {
            font-size: 1rem;
            font-weight: 600;
            color: #333;
        }

        .quote-item-cost-secondary {
            font-size: 0.75rem;
            color: #666;
        }

        .quote-item-actions {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 0.75rem;
        }

        .quote-item-actions button {
            padding: 0.375rem 0.75rem;
            border: 1px solid #e0e0e0;
            background: white;
            border-radius: 0.375rem;
            font-size: 0.8125rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .quote-item-actions button:hover {
            border-color: #999;
        }

        .quote-item-actions .remove-btn {
            color: #d32f2f;
            border-color: #ffcdd2;
        }

        .quote-item-actions .remove-btn:hover {
            background: #ffebee;
            border-color: #e57373;
        }

        .role-line {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 0.8125rem;
            color: #666;
            padding: 0.375rem 0;
        }

        .role-name {
            font-weight: 500;
        }

        .role-hours {
            color: #999;
        }

        .totals-section {
            margin-top: 1.5rem;
            padding-top: 1.5rem;
            border-top: 2px solid #e0e0e0;
        }

        .revenue-input-section {
            background: #fafafa;
            border: 1px solid #e0e0e0;
            border-radius: 0.5rem;
            padding: 1.25rem;
            margin-bottom: 1.5rem;
        }

        .revenue-input-label {
            font-size: 0.875rem;
            font-weight: 500;
            color: #666;
            margin-bottom: 0.5rem;
            display: block;
        }

        .revenue-input-wrapper {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 0.75rem;
        }

        .currency-symbol {
            font-size: 1.125rem;
            font-weight: 600;
            color: #333;
        }

        .revenue-input {
            flex: 1;
            padding: 0.625rem 0.75rem;
            border: 1px solid #ddd;
            border-radius: 0.375rem;
            font-size: 1rem;
            text-align: left;
        }

        .profit-suggestions {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
        }

        .profit-suggestion-btn {
            padding: 0.375rem 0.75rem;
            background: white;
            border: 1px solid #e0e0e0;
            border-radius: 0.375rem;
            font-size: 0.75rem;
            color: #666;
            cursor: pointer;
            transition: all 0.2s;
        }

        .profit-suggestion-btn:hover {
            background: #333;
            color: white;
            border-color: #333;
        }

        .total-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.75rem 0;
            border-bottom: 1px solid #f0f0f0;
        }

        .total-row-label {
            font-size: 0.9375rem;
            color: #666;
        }

        .total-row-amount {
            text-align: right;
        }

        .total-row-primary {
            font-size: 1rem;
            font-weight: 600;
            color: #333;
        }

        .total-row-secondary {
            font-size: 0.75rem;
            color: #999;
        }

        .grand-total {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1rem 0 0.5rem 0;
            margin-top: 0.5rem;
        }

        .grand-total-label {
            font-size: 1.125rem;
            font-weight: 600;
            color: #333;
        }

        .grand-total-amount {
            text-align: right;
        }

        .grand-total-primary {
            font-size: 1.5rem;
            font-weight: 700;
            color: #333;
        }

        .grand-total-secondary {
            font-size: 0.875rem;
            color: #999;
        }

        .total-meta {
            font-size: 0.8125rem;
            color: #999;
            text-align: right;
            margin-top: 0.5rem;
        }

        .team-breakdown {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .team-item {
            background: #fafafa;
            border: 1px solid #e0e0e0;
            border-radius: 0.5rem;
            padding: 1rem;
        }

        .team-header {
            display: flex;
            align-items: start;
            justify-content: space-between;
            margin-bottom: 0.5rem;
        }

        .team-role-info {
            flex: 1;
        }

        .team-role-name {
            font-size: 0.9375rem;
            font-weight: 600;
            color: #333;
            margin-bottom: 0.25rem;
        }

        .team-role-desc {
            font-size: 0.8125rem;
            color: #666;
            line-height: 1.4;
        }

        .team-cost {
            text-align: right;
            margin-left: 1rem;
        }

        .team-cost-label {
            font-size: 0.75rem;
            color: #999;
            margin-bottom: 0.25rem;
        }

        .team-cost-primary {
            font-size: 1rem;
            font-weight: 600;
            color: #333;
        }

        .team-cost-secondary {
            font-size: 0.75rem;
            color: #999;
        }

        .team-meta {
            font-size: 0.8125rem;
            color: #999;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .outsourced-total {
            margin-top: 1.5rem;
            padding: 1rem;
            background: #f0f9ff;
            border: 1px solid #bae6fd;
            border-radius: 0.5rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .outsourced-label {
            font-size: 0.9375rem;
            font-weight: 600;
            color: #0369a1;
        }

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

        .outsourced-amount-primary {
            font-size: 1rem;
            font-weight: 600;
            color: #0369a1;
        }

        .outsourced-amount-secondary {
            font-size: 0.75rem;
            color: #0c4a6e;
        }

        .team-total {
            margin-top: 1.5rem;
            padding-top: 1.5rem;
            border-top: 2px solid #e0e0e0;
        }

        .team-total-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .team-total-label {
            font-size: 1.125rem;
            font-weight: 600;
            color: #333;
        }

        .team-total-amount {
            text-align: right;
        }

        .team-total-primary {
            font-size: 1.5rem;
            font-weight: 700;
            color: #333;
        }

        .team-total-secondary {
            font-size: 0.875rem;
            color: #999;
        }

        .modal {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            padding: 1rem;
        }

        .modal-content {
            background: white;
            border-radius: 0.75rem;
            max-width: 600px;
            width: 100%;
            max-height: 90vh;
            overflow-y: auto;
        }

        .modal-header {
            padding: 1.5rem;
            border-bottom: 1px solid #e0e0e0;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .modal-title {
            font-size: 1.25rem;
            font-weight: 600;
            color: #333;
        }

        .close-btn {
            background: none;
            border: none;
            font-size: 1.5rem;
            color: #999;
            cursor: pointer;
            padding: 0;
            width: 2rem;
            height: 2rem;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .close-btn:hover {
            color: #333;
        }

        .modal-body {
            padding: 1.5rem;
        }

        .modal-footer {
            padding: 1.5rem;
            border-top: 1px solid #e0e0e0;
            display: flex;
            gap: 0.75rem;
            justify-content: flex-end;
        }

        .btn-cancel,
        .btn-save,
        .btn-save-new {
            padding: 0.625rem 1.5rem;
            border: none;
            border-radius: 0.5rem;
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-cancel {
            background: #f5f5f5;
            color: #666;
        }

        .btn-cancel:hover {
            background: #e0e0e0;
        }

        .btn-save {
            background: #333;
            color: white;
        }

        .btn-save:hover {
            background: #555;
        }

        .btn-save-new {
            background: #1976d2;
            color: white;
        }

        .btn-save-new:hover {
            background: #1565c0;
        }

        .form-group {
            margin-bottom: 1.25rem;
        }

        .form-label {
            display: block;
            font-size: 0.875rem;
            font-weight: 500;
            color: #333;
            margin-bottom: 0.5rem;
        }

        .form-input,
        .form-select,
        .form-textarea {
            width: 100%;
            padding: 0.625rem 0.75rem;
            border: 1px solid #ddd;
            border-radius: 0.375rem;
            font-size: 0.9375rem;
        }

        .form-textarea {
            min-height: 80px;
            resize: vertical;
        }

        .role-inputs {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
        }

        .role-input-row {
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .role-input-row select {
            flex: 2;
        }

        .role-input-row input {
            flex: 1;
        }

        .add-role-btn,
        .remove-role-btn {
            padding: 0.5rem 1rem;
            border: 1px solid #e0e0e0;
            background: white;
            border-radius: 0.375rem;
            font-size: 0.875rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .add-role-btn {
            width: 100%;
            margin-top: 0.5rem;
        }

        .add-role-btn:hover {
            background: #f5f5f5;
        }

        .remove-role-btn {
            color: #d32f2f;
            padding: 0.5rem 0.75rem;
        }

        .remove-role-btn:hover {
            background: #ffebee;
            border-color: #e57373;
        }

        .edit-roles {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .edit-role-row {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .edit-role-info {
            flex: 1;
        }

        .edit-role-name {
            font-size: 0.9375rem;
            font-weight: 600;
            color: #333;
            margin-bottom: 0.25rem;
        }

        .edit-role-desc {
            font-size: 0.8125rem;
            color: #666;
        }

        .edit-hours-input {
            width: 100px;
            padding: 0.5rem;
            border: 1px solid #ddd;
            border-radius: 0.375rem;
            text-align: center;
        }

        .edit-cost {
            width: 120px;
            text-align: right;
        }

        .edit-cost-label {
            font-size: 0.75rem;
            color: #999;
            margin-bottom: 0.25rem;
        }

        .edit-cost-primary {
            font-size: 0.9375rem;
            font-weight: 600;
            color: #333;
        }

        .edit-cost-secondary {
            font-size: 0.75rem;
            color: #999;
        }

        .split-mode-selector {
            background: #f5f5f5;
            padding: 1rem;
            border-radius: 0.5rem;
            margin-bottom: 1.5rem;
        }

        .split-mode-text {
            font-size: 0.875rem;
            color: #666;
            margin-bottom: 0.75rem;
        }

        .split-mode-buttons {
            display: flex;
            gap: 0.5rem;
        }

        .split-mode-btn {
            flex: 1;
            padding: 0.625rem;
            border: 1px solid #ddd;
            background: white;
            border-radius: 0.375rem;
            font-size: 0.875rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .split-mode-btn:hover {
            border-color: #999;
        }

        .split-mode-btn.active {
            background: #333;
            color: white;
            border-color: #333;
        }

        .split-notice {
            background: #e3f2fd;
            padding: 1rem;
            border-radius: 0.5rem;
            margin-top: 1rem;
        }

        .split-notice-text {
            font-size: 0.875rem;
            color: #1976d2;
        }

        .third-party-section {
            margin-top: 1.5rem;
        }

        .third-party-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
        }

        .third-party-title {
            font-size: 1rem;
            font-weight: 600;
            color: #333;
        }

        .add-third-party-btn {
            padding: 0.5rem 1rem;
            background: #333;
            color: white;
            border: none;
            border-radius: 0.375rem;
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }

        .add-third-party-btn:hover {
            background: #555;
        }

        .third-party-item {
            background: #fafafa;
            border: 1px solid #e0e0e0;
            border-radius: 0.5rem;
            padding: 0.75rem 1rem;
            margin-bottom: 0.5rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .third-party-name {
            font-size: 0.9375rem;
            color: #333;
            font-weight: 500;
        }

        .third-party-actions {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .third-party-amount {
            font-size: 0.9375rem;
            font-weight: 600;
            color: #333;
        }

        .third-party-remove {
            background: none;
            border: none;
            color: #d32f2f;
            cursor: pointer;
            font-size: 1.25rem;
            padding: 0;
            width: 1.5rem;
            height: 1.5rem;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .third-party-remove:hover {
            color: #b71c1c;
        }

        #add-products {
            display: grid;
            grid-template-columns: 1fr 1fr; 
            gap: 20px;
        }