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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Upload Section */
.upload-section {
    padding: 40px;
    border-bottom: 1px solid #e5e7eb;
}

.upload-area {
    border: 3px dashed #d1d5db;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #f9fafb;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #4f46e5;
    background: #eef2ff;
    transform: translateY(-2px);
}

.upload-content i {
    font-size: 3rem;
    color: #6b7280;
    margin-bottom: 20px;
}

.upload-content h3 {
    font-size: 1.5rem;
    color: #374151;
    margin-bottom: 10px;
}

.upload-content p {
    color: #6b7280;
    font-size: 1rem;
}

.upload-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

#fileName {
    font-weight: 600;
    color: #374151;
    flex: 1;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

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

.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #e5e7eb;
    transform: translateY(-2px);
}

/* Pricing Section */
.pricing-section {
    padding: 40px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.pricing-section h3 {
    font-size: 1.5rem;
    color: #1f2937;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pricing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.pricing-tier {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.pricing-tier h4 {
    color: #374151;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.tier-inputs {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-group label {
    min-width: 100px;
    color: #4b5563;
    font-weight: 500;
}

.input-group input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
}

.input-group span {
    color: #6b7280;
    font-weight: 600;
}

/* Loading Section */
.loading-section {
    padding: 60px;
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Progress Bar */
.progress-container {
    margin-top: 30px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #374151;
}

.progress-info span {
    font-weight: 500;
}

.progress-percentage {
    color: #4f46e5;
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-details {
    text-align: center;
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 500;
}

/* Results Section */
.results-section {
    padding: 40px;
}

.results-section h3 {
    font-size: 1.5rem;
    color: #1f2937;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.color-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.bw-icon {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

.total-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.price-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.card-content h4 {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 5px;
    font-weight: 500;
}

.card-content span {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1f2937;
}

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.chart-container {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.details-panel {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.page-lists {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.page-list h4 {
    font-size: 1.1rem;
    color: #374151;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.page-number {
    background: #f3f4f6;
    color: #374151;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.page-number.color {
    background: #fef3c7;
    color: #d97706;
}

/* Detailed Analysis */
.detailed-analysis,
.cost-breakdown {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
}

.detailed-analysis h4,
.cost-breakdown h4 {
    font-size: 1.2rem;
    color: #374151;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.analysis-table {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.analysis-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.analysis-table th {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: white;
    padding: 12px 8px;
    font-weight: 600;
    text-align: left;
    font-size: 0.875rem;
}

.analysis-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.analysis-table tr:hover {
    background-color: #f9fafb;
}

.analysis-table tr:last-child td {
    border-bottom: none;
}

/* Percentage cells with bar charts */
.percentage-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 80px;
}

.percentage-text {
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
}

.percentage-bar {
    width: 60px;
    height: 6px;
    background-color: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.percentage-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
    position: relative;
}

.percentage-fill.color-fill {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    box-shadow: 0 1px 3px rgba(245, 158, 11, 0.3);
}

.percentage-fill.significant-fill {
    background: linear-gradient(90deg, #ef4444, #dc2626);
    box-shadow: 0 1px 3px rgba(220, 38, 38, 0.3);
}

/* Hover effects for percentage bars */
.percentage-cell:hover .percentage-bar {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

.percentage-cell:hover .percentage-fill {
    opacity: 0.8;
}

.color-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.color-indicator.color {
    background: #f59e0b;
}

.color-indicator.bw {
    background: #6b7280;
}

.breakdown-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
}

.breakdown-total {
    font-weight: 700;
    font-size: 1.1rem;
    background: #eef2ff !important;
    color: #4f46e5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 15px;
    }
    
    .header {
        padding: 30px 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .upload-section,
    .pricing-section,
    .results-section {
        padding: 20px;
    }
    
    .pricing-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-section {
        grid-template-columns: 1fr;
    }
    
    .upload-info {
        flex-direction: column;
        align-items: stretch;
    }
    
    .upload-info > * {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 20px;
    }
}

/* Color Areas Modal */
.color-areas-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-body {
    padding: 25px;
}

.color-info {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #4f46e5;
}

.color-info p {
    margin: 8px 0;
    color: #374151;
}

.page-preview-container {
    text-align: center;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 20px;
    background: #f9fafb;
}

#colorAreasCanvas {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* View Color Button */
.btn-view-color {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-view-color:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

.no-action {
    color: #9ca3af;
    font-style: italic;
}

/* Improved table styles */
.analysis-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.analysis-table th:last-child,
.analysis-table td:last-child {
    text-align: center;
    width: 120px;
}

.analysis-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    padding: 12px 8px;
    text-align: left;
    border-bottom: 2px solid #e5e7eb;
}

.analysis-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

/* Modal Controls */
.modal-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0;
    padding: 10px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.toggle-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.toggle-container input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.toggle-text {
    font-weight: 500;
    color: #374151;
}

.btn-bw-preview {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 5px;
}

.btn-bw-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(107, 114, 128, 0.3);
}

.verification-info {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0c4a6e;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.verification-info p {
    margin: 0;
    font-size: 0.9rem;
}

/* Improved Actions column */
.analysis-table th:last-child,
.analysis-table td:last-child {
    text-align: center;
    width: 200px;
    white-space: nowrap;
}

/* Manual Override Styles */
.override-badge {
    background: #10b981;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: 500;
}

/* Elegant Toggle Switch */
.override-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    cursor: pointer;
    user-select: none;
}

.toggle-input {
    display: none;
}

.toggle-slider {
    position: relative;
    display: flex;
    align-items: center;
    width: 80px;
    height: 28px;
    background: #e5e7eb;
    border-radius: 14px;
    transition: all 0.3s ease;
    border: 2px solid #d1d5db;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 1px;
    left: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.toggle-input:checked + .toggle-slider {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-color: #d97706;
}

.toggle-input:checked + .toggle-slider::before {
    transform: translateX(52px);
}

.toggle-option {
    position: absolute;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 1;
    transition: all 0.3s ease;
}

.toggle-option.left {
    left: 6px;
    color: #4b5563;
}

.toggle-option.right {
    right: 4px;
    color: white;
    opacity: 0.7;
}

.toggle-input:checked + .toggle-slider .toggle-option.left {
    color: white;
    opacity: 0.7;
}

.toggle-input:checked + .toggle-slider .toggle-option.right {
    color: white;
    opacity: 1;
}

.toggle-switch:hover .toggle-slider {
    transform: scale(1.05);
}

/* Collapsible Section Styles */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 20px 25px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px 12px 0 0;
    transition: all 0.3s ease;
    border-bottom: 1px solid #e2e8f0;
}

.section-header:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%);
}

.section-header h4 {
    margin: 0;
    font-size: 1.2rem;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 10px;
}

.collapse-btn {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.collapse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.3);
}

.collapse-btn.expanded {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.collapse-btn.expanded:hover {
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.collapsible-content {
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s ease;
    max-height: 0;
    opacity: 0;
}

.collapsible-content .analysis-table {
    padding: 0;
    background: white;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
}

/* Remove old button styles - they're no longer needed */
.btn-override {
    display: none;
}

/* Override Notifications */
.override-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease-out, slideOutRight 0.3s ease-in 2.7s forwards;
}

.override-notification.override-color {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.override-notification.override-bw {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Adjust table layout for toggle switches */
.analysis-table th:nth-child(7),
.analysis-table td:nth-child(7) {
    width: 90px;
    text-align: center;
}

.analysis-table th:nth-child(8),
.analysis-table td:nth-child(8) {
    width: 200px;
    text-align: center;
}

/* Manual Overrides Summary */
.overrides-summary {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
    border-left: 4px solid #10b981;
}

.overrides-summary h4 {
    font-size: 1.2rem;
    color: #374151;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.overrides-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.override-info {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: 12px 15px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.override-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.override-label {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 160px;
}

.override-label.color {
    color: #d97706;
}

.override-label.bw {
    color: #4b5563;
}

.override-pages {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Settings Notifications */
.settings-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1002;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease-out, slideOutRight 0.3s ease-in 2.7s forwards;
}

.settings-notification.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.settings-notification.info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

/* Pricing Modal */
.pricing-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.pricing-modal .modal-content {
    background: white;
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.pricing-modal .modal-header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pricing-modal .modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.pricing-modal .modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 1.1rem;
}

.pricing-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.pricing-modal .modal-body {
    padding: 0;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

/* Pricing Tabs */
.pricing-tabs {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 20px;
    font-size: 1rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn:hover {
    background: #f1f5f9;
    color: #475569;
}

.tab-btn.active {
    background: white;
    color: #4f46e5;
    border-bottom-color: #4f46e5;
}

/* Tab Content */
.tab-content {
    min-height: 400px;
}

.tab-panel {
    display: none;
    padding: 30px;
}

.tab-panel.active {
    display: block;
}

/* Pricing Ranges */
.pricing-ranges-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pricing-ranges {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pricing-range-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.pricing-range-card:hover {
    border-color: #4f46e5;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
}

.range-header {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
}

.range-title {
    font-weight: 600;
    color: #374151;
    font-size: 0.95rem;
}

.range-form {
    padding: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
}

.form-input {
    padding: 12px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-input:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

.price-input {
    display: flex;
    align-items: center;
    position: relative;
}

.currency {
    position: absolute;
    left: 14px;
    color: #6b7280;
    font-weight: 600;
    pointer-events: none;
    z-index: 1;
}

.price-input .form-input {
    padding-left: 45px;
}

/* Range Options */
.range-options {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #374151;
    user-select: none;
}

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

.btn-remove-range {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-remove-range:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-remove-range:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-add-range {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.95rem;
}

.btn-add-range:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding: 25px 30px;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
}

/* Enhanced Cost Breakdown */
.cost-section {
    margin-bottom: 30px;
}

.section-title {
    color: #374151;
    font-size: 1.1rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

.cost-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 15px;
}

.cost-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
}

.cost-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.range-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-range {
    font-weight: 600;
    color: #374151;
}

.unit-price {
    font-size: 0.9rem;
    color: #6b7280;
    background: #e5e7eb;
    padding: 4px 8px;
    border-radius: 4px;
}

.calculation {
    font-size: 0.95rem;
    color: #4b5563;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.subtotal {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #374151;
}

.cost-total {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

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

.total-label {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
}

.total-amount {
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
}

/* Action buttons styling */
.action-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Responsive design for pricing modal */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .pricing-modal .modal-body {
        padding: 0;
    }
    
    .tab-panel {
        padding: 20px;
    }
    
    .range-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* Settings Status */
.settings-status {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 20px;
}

.status-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #0369a1;
}

.status-info i {
    color: #0ea5e9;
}

.status-info small {
    margin-left: auto;
    opacity: 0.7;
    font-size: 0.8rem;
}

/* Warning styles for notifications */
.settings-notification.warning {
    background: #fbbf24;
    color: #92400e;
}

.settings-notification.warning .notification-content i {
    color: #f59e0b;
}

.settings-notification.info {
    background: #60a5fa;
    color: #1e40af;
}

.settings-notification.info .notification-content i {
    color: #3b82f6;
}

/* Pricing method segmented controls */
.pricing-method-section {
    margin-bottom: 16px;
}

.pricing-method-options {
    display: inline-flex;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #f9fafb;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.pricing-method-options .radio-option {
    display: flex;
    align-items: stretch;
}

.pricing-method-options .radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pricing-method-options .radio-label {
    padding: 10px 14px;
    min-width: 160px;
    cursor: pointer;
    text-align: center;
    color: #374151;
    background: transparent;
    border-right: 1px solid #e5e7eb;
    transition: background 0.2s ease, color 0.2s ease;
}

.pricing-method-options .radio-option:last-child .radio-label {
    border-right: none;
}

.pricing-method-options .radio-label strong {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
}

.pricing-method-options .radio-label small {
    display: block;
    margin-top: 4px;
    font-size: 0.78rem;
    color: #6b7280;
}

.pricing-method-options .radio-option input:checked + .radio-label {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
}

.pricing-method-options .radio-option input:checked + .radio-label small {
    color: #ffffff;
    opacity: 0.95;
}

.percentage-pricing-section {
    margin-top: 12px;
    padding: 12px;
    border: 1px dashed #e5e7eb;
    border-radius: 10px;
    background: #fafafa;
}