:root {
    --primary: #1a3a5c;
    --primary-dark: #0f2640;
    --primary-light: #e8f1f8;
    --accent: #5cb8d6;
    --accent-light: #e6f5fa;
    --bg: #f5f7fa;
    --bg-card: #ffffff;
    --text: #1a1a2e;
    --text-secondary: #5a6175;
    --border: #e0e4eb;
    --danger: #dc3545;
    --warning: #f0ad4e;
    --success: #28a745;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --radius: 10px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo-img {
    height: 44px;
    width: auto;
    object-fit: contain;
}

.nav-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.nav-title {
    font-weight: 400;
    font-size: 18px;
    color: var(--primary);
}

.nav-title strong {
    font-weight: 800;
}

.nav-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-link:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-link.active {
    background: var(--primary);
    color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.page-header {
    margin-bottom: 28px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 15px;
}

.quote-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.quote-form-panel,
.quote-result-panel {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.form-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

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

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text);
    background: #fff;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

textarea.form-control {
    resize: vertical;
}

.checkbox-group {
    margin-top: 4px;
}

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

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-full {
    width: 100%;
}

.hidden {
    display: none !important;
}

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

.result-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
}

.result-header h2 {
    font-size: 22px;
}

.result-badge {
    font-size: 11px;
    font-weight: 600;
    background: var(--accent-light);
    color: var(--accent);
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-price-block {
    margin-bottom: 20px;
}

.result-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.result-price {
    font-size: 48px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -1px;
}

.result-detail {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.checkmark {
    color: var(--accent);
    font-weight: 700;
}

.result-note {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    padding: 12px;
    background: var(--bg);
    border-radius: 6px;
}

.save-confirm {
    margin-top: 10px;
    padding: 8px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

.quote-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.placeholder-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.admin-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.tab-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--primary);
}

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

.admin-calc-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.admin-form-panel,
.admin-result-panel {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.admin-form-panel h3,
.admin-result-panel h3 {
    margin-bottom: 16px;
    font-size: 16px;
}

.breakdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.breakdown-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.breakdown-section:last-of-type {
    border-bottom: none;
}

.breakdown-section h4 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.breakdown-table th {
    text-align: left;
    padding: 6px 8px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

.breakdown-table td {
    padding: 5px 8px;
    border-bottom: 1px solid #f0f0f0;
}

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

.breakdown-table .label-cell {
    color: var(--text-secondary);
}

.breakdown-table .value-cell {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.breakdown-table .total-row td {
    font-weight: 700;
    border-top: 2px solid var(--border);
    padding-top: 8px;
}

.final-price-section {
    background: var(--primary-light);
    border-radius: 8px;
    padding: 16px !important;
    border-bottom: none !important;
    margin-bottom: 0 !important;
}

.final-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    font-weight: 700;
}

.final-price {
    font-size: 28px;
    color: var(--primary);
}

.panel {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.panel-header h3 {
    margin: 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.data-table tbody tr:hover {
    background: var(--bg);
}

.data-table.compact td,
.data-table.compact th {
    padding: 6px 10px;
    font-size: 13px;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 14px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.settings-card {
    background: var(--bg);
    border-radius: 8px;
    padding: 16px;
}

.settings-card h4 {
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--primary);
}

.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: 200;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

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

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-draft { background: #fff3cd; color: #856404; }
.status-completed { background: #d4edda; color: #155724; }
.status-in_progress { background: #cce5ff; color: #004085; }
.status-cancelled { background: #f8d7da; color: #721c24; }

.view-btn {
    font-size: 13px;
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    text-decoration: underline;
}

.wizard-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 4px;
    background: var(--bg-card);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 8px 12px 0;
    box-shadow: var(--shadow);
}

.wizard-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.wizard-tab:hover {
    color: var(--primary);
    background: var(--primary-light);
    border-radius: 6px 6px 0 0;
}

.wizard-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.wizard-tab.completed {
    color: var(--success);
}

.wizard-tab.completed .wizard-tab-num {
    background: var(--success);
    color: #fff;
}

.wizard-tab-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    background: var(--border);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.wizard-tab.active .wizard-tab-num {
    background: var(--primary);
    color: #fff;
}

.wizard-tab-label {
    font-size: 12px;
}

.wizard-progress {
    height: 4px;
    background: var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
}

.wizard-progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.4s ease;
    width: 0%;
}

.wizard-page {
    display: none;
    animation: wizardFadeIn 0.3s ease;
}

.wizard-page.active {
    display: block;
}

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

.wizard-page-header {
    margin-bottom: 20px;
}

.wizard-page-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.wizard-page-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

.wizard-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    margin-top: 16px;
    border-top: 1px solid var(--border);
}

.wizard-btn-back,
.wizard-btn-next {
    min-width: 120px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
}

.wizard-step-indicator {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.review-summary {
    margin-bottom: 24px;
}

.review-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 12px;
}

.review-section h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
}

.review-count {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: 8px;
}

.review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.review-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.review-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.review-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.review-task-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 4px;
}

.review-task {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: var(--bg);
    border-radius: 6px;
    font-size: 13px;
}

.review-task-name {
    font-weight: 500;
    color: var(--text);
}

.review-task-tier {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-card);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid var(--border);
    white-space: nowrap;
}

.review-disabled {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
}

.review-disabled-label {
    font-weight: 600;
    font-style: normal;
}

.tier-guide-inline {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    padding: 16px 20px;
}

.tier-guide-inline-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
}

.tier-guide-inline-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.tier-guide-inline-card {
    border-radius: 8px;
    padding: 14px;
    background: var(--bg);
    border: 1px solid var(--border);
}

.tier-guide-inline-1 {
    border-left: 4px solid var(--success);
}

.tier-guide-inline-2 {
    border-left: 4px solid var(--warning);
}

.tier-guide-inline-3 {
    border-left: 4px solid var(--danger);
}

.tier-guide-inline-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.tier-guide-inline-summary {
    font-size: 12px;
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.tier-guide-inline-bullets {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tier-guide-inline-bullets li {
    font-size: 12.5px;
    color: var(--text);
    padding: 2px 0;
    padding-left: 14px;
    position: relative;
    line-height: 1.4;
}

.tier-guide-inline-bullets li::before {
    content: "\2022";
    position: absolute;
    left: 0;
    color: var(--text-secondary);
}

.quote-top-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.top-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.top-card h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.tier-reference-guide {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    overflow: hidden;
}

.tier-guide-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    text-align: left;
}

.tier-guide-toggle:hover {
    background: var(--primary-light);
}

.tier-guide-icon {
    font-size: 20px;
}

.tier-guide-arrow {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-secondary);
}

.tier-guide-content {
    padding: 0 24px 24px;
}

.tier-guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.tier-guide-card {
    border-radius: 8px;
    padding: 16px;
    border: 1px solid var(--border);
    background: var(--bg);
}

.tier-guide-tier1 {
    border-left: 4px solid var(--success);
}

.tier-guide-tier2 {
    border-left: 4px solid var(--warning);
}

.tier-guide-tier3 {
    border-left: 4px solid var(--danger);
}

.tier-guide-retrofit {
    border-left: 4px solid var(--primary);
}

.tier-guide-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.tier-guide-badge {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.tier-guide-mult {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 12px;
}

.tier-guide-summary {
    font-size: 13px;
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.tier-guide-bullets {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tier-guide-bullets li {
    font-size: 12.5px;
    color: var(--text);
    padding: 3px 0;
    padding-left: 16px;
    position: relative;
    line-height: 1.4;
}

.tier-guide-bullets li::before {
    content: "\2022";
    position: absolute;
    left: 0;
    color: var(--text-secondary);
}

.tier-guide-divider {
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}

.tier-guide-subtitle {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

.task-complexity-section,
.task-category-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.task-complexity-section h3,
.task-category-section h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-light);
}

.category-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auto-tier-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    background: var(--primary-light);
    border: 2px solid var(--primary);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.auto-tier-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.auto-tier-value {
    font-weight: 700;
}

.auto-tier-simple {
    color: var(--success);
}

.auto-tier-moderate {
    color: var(--warning);
}

.auto-tier-complex {
    color: var(--danger);
}

.task-group {
    margin-bottom: 16px;
}

.task-group-header {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 12px;
    margin-bottom: 6px;
    background: var(--primary-light);
    border-radius: 6px;
    border-left: 3px solid var(--accent);
}

.task-weight-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    flex-shrink: 0;
    line-height: 1.4;
}

.task-weight-badge.weight-1 {
    background: #e8f5e9;
    color: #2e7d32;
}

.task-weight-badge.weight-2 {
    background: #fff3e0;
    color: #e65100;
}

.task-weight-badge.weight-3 {
    background: #fce4ec;
    color: #c62828;
}

.task-auto-tier3-flag {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    background: var(--danger);
    color: #fff;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.task-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 6px;
}

.task-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 12px;
    border-radius: 6px;
    background: var(--bg);
}

.task-row:hover {
    background: var(--primary-light);
}

.task-row.system-hidden {
    display: none !important;
}

.task-enable-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}

.task-enable {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.task-label {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-tier-select {
    width: 200px;
    flex-shrink: 0;
    padding: 6px 10px;
    font-size: 13px;
}

.btn-generate {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 0 auto 40px;
    padding: 14px 24px;
    font-size: 16px;
}

.invoice-panel {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    max-width: 900px;
    margin: 0 auto 40px;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--primary);
}

.invoice-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.invoice-logo-img {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.invoice-brand h2 {
    font-size: 20px;
    color: var(--primary);
    margin-bottom: 2px;
}

.invoice-brand p {
    font-size: 13px;
    color: var(--text-secondary);
}

.invoice-brand-sub {
    font-size: 12px;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 2px;
}

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

.invoice-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    background: var(--accent-light);
    color: var(--accent);
    padding: 3px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.invoice-date {
    font-size: 13px;
    color: var(--text-secondary);
}

.invoice-customer {
    margin-bottom: 16px;
    font-size: 15px;
}

.invoice-config {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 24px;
    padding: 10px 14px;
    background: var(--bg);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.config-sep {
    color: var(--border);
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
    font-size: 14px;
}

.invoice-table th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
}

.invoice-table td {
    padding: 9px 12px;
    border-bottom: 1px solid #f0f2f5;
}

.invoice-table .col-price {
    text-align: right;
    width: 120px;
}

.invoice-table .col-tier {
    width: 120px;
}

.invoice-table .price-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.invoice-table .tier-cell {
    color: var(--text-secondary);
    font-size: 13px;
}

.invoice-table .section-header td {
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    background: var(--primary-light);
    border-bottom: 1px solid var(--border);
    padding: 8px 12px;
}

.invoice-table tfoot .subtotal-row td {
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    padding: 8px 12px;
}

.invoice-table tfoot .total-row td {
    font-size: 18px;
    font-weight: 800;
    border-top: 2px solid var(--text);
    border-bottom: none;
    padding: 14px 12px;
}

.invoice-table tfoot .total-row .price-cell {
    color: var(--primary);
}

.invoice-note {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 12px 14px;
    background: var(--bg);
    border-radius: 6px;
    margin-bottom: 20px;
}

.invoice-actions {
    display: flex;
    gap: 10px;
}

@media print {
    .navbar, .wizard-tabs, .wizard-progress, .wizard-nav, .wizard-page-header,
    .quote-top-row, .task-complexity-section, .task-category-section,
    .tier-reference-guide, .tier-guide-inline, .btn-generate, .invoice-actions,
    .save-confirm, .review-summary, #quoteForm { display: none !important; }
    .invoice-panel { box-shadow: none; padding: 0; margin: 0; }
    .hidden { display: block !important; }
    #invoiceResult { display: block !important; }
}

@media (max-width: 1024px) {
    .quote-top-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .wizard-tab-label {
        display: none;
    }

    .wizard-tab {
        padding: 10px 10px;
    }
}

@media (max-width: 768px) {
    .quote-layout,
    .admin-calc-layout {
        grid-template-columns: 1fr;
    }

    .quote-top-row {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .task-grid {
        grid-template-columns: 1fr;
    }

    .task-row {
        flex-direction: column;
        align-items: stretch;
    }

    .task-tier-select {
        width: 100%;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .nav-subtitle {
        display: none;
    }

    .nav-logo-img {
        height: 34px;
    }

    .container {
        padding: 16px;
    }

    .result-price {
        font-size: 36px;
    }

    .admin-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .wizard-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .invoice-header {
        flex-direction: column;
        gap: 12px;
    }

    .invoice-meta {
        text-align: left;
    }

    .invoice-actions {
        flex-direction: column;
    }

    .review-grid {
        grid-template-columns: 1fr;
    }

    .review-task-list {
        grid-template-columns: 1fr;
    }

    .tier-guide-inline-grid {
        grid-template-columns: 1fr;
    }
}

.category-none-bar {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-none-toggle {
    background: #2a2d35;
    color: #b0b8c8;
    border: 1px solid #3a3f4a;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-none-toggle:hover {
    background: #3a3f4a;
    border-color: #e74c3c;
    color: #e74c3c;
}

.btn-none-toggle.btn-none-active {
    background: #1a3a1a;
    border-color: #2ecc71;
    color: #2ecc71;
}

.btn-none-toggle.btn-none-active:hover {
    background: #1a4a1a;
}

.none-icon {
    font-weight: bold;
    font-size: 1rem;
}

.none-active-label {
    color: #f39c12;
    font-size: 0.9rem;
    padding: 8px 14px;
    background: rgba(243, 156, 18, 0.08);
    border: 1px solid rgba(243, 156, 18, 0.2);
    border-radius: 6px;
}

.category-content-wrapper.hidden {
    display: none;
}

.auto-tier-none {
    color: #7f8c8d;
    background: rgba(127, 140, 141, 0.1);
    border-color: rgba(127, 140, 141, 0.3);
}

.review-none-badge {
    display: inline-block;
    background: rgba(127, 140, 141, 0.15);
    color: #95a5a6;
    font-size: 0.75rem;
    padding: 2px 10px;
    border-radius: 4px;
    font-weight: 500;
    margin-left: 8px;
    vertical-align: middle;
}

.review-section-none {
    opacity: 0.6;
}

.plumbing-filtration-selector {
    margin-bottom: 20px;
    padding: 16px 20px;
    background: #1e2028;
    border: 1px solid #3a3f4a;
    border-radius: 8px;
}

.plumbing-filtration-selector label {
    font-weight: 600;
    color: #f0f0f0;
    margin-bottom: 6px;
    display: block;
    font-size: 0.95rem;
}

.plumbing-filtration-selector select {
    max-width: 360px;
}

.plumbing-filtration-hint {
    margin-top: 10px;
    color: #95a5a6;
    font-size: 0.9rem;
    font-style: italic;
}

.bundle-row td {
    padding: 12px 10px;
    font-size: 1rem;
    font-weight: 500;
    border-bottom: 1px solid #ecf0f1;
}

.bundle-row td:first-child {
    color: #2c3e50;
}

.bundle-row td.price-cell {
    font-weight: 600;
    color: #27ae60;
}

.settings-page-layout {
    max-width: 800px;
}

.settings-section-title {
    margin-top: 28px;
    margin-bottom: 12px;
    padding-top: 20px;
    border-top: 1px solid #2a2d35;
    font-size: 1.1rem;
    color: #f0f0f0;
}

.settings-description {
    color: #8a94a6;
    font-size: 0.9rem;
    margin-bottom: 16px;
    line-height: 1.5;
}

.form-hint {
    display: block;
    color: #6b7280;
    font-size: 0.8rem;
    margin-top: 4px;
}

.settings-actions {
    margin-top: 28px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.save-confirm {
    color: #2ecc71;
    font-weight: 500;
    font-size: 0.95rem;
}

.logo-upload-area {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 8px;
}

.logo-preview {
    width: 120px;
    height: 80px;
    border: 2px dashed var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--bg);
    flex-shrink: 0;
}

.logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.logo-placeholder {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-align: center;
    padding: 8px;
}

.logo-upload-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.logo-upload-btn {
    cursor: pointer;
}

.logo-upload-btn input[type="file"] {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-danger:hover {
    background: #c0392b;
}

.invoice-powered-by {
    text-align: center;
    color: #b0b8c8;
    font-size: 0.75rem;
    padding: 12px 0 4px;
    border-top: 1px solid var(--border);
    margin-top: 16px;
    letter-spacing: 0.3px;
}

.invoice-powered-by strong {
    color: #8a94a6;
    font-weight: 600;
}

@media print {
    .invoice-powered-by {
        display: block;
    }
}

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow);
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo {
    height: 60px;
    width: auto;
    margin-bottom: 16px;
}

.login-header h2 {
    font-size: 1.4rem;
    color: var(--primary);
    margin-bottom: 6px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.login-error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    text-align: center;
}

.login-pin-input {
    text-align: center;
    font-size: 1.3rem;
    letter-spacing: 6px;
    padding: 12px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.settings-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.breakdown-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 299;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.breakdown-panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

.breakdown-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 420px;
    min-width: 320px;
    max-width: 80vw;
    background: var(--bg-card);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    z-index: 300;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.breakdown-panel.open {
    transform: translateX(0);
}

.breakdown-section {
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    padding: 12px 14px;
}

.breakdown-section h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.breakdown-table th {
    text-align: left;
    padding: 5px 8px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.breakdown-table td {
    padding: 5px 8px;
    border-bottom: 1px solid #f0f2f5;
    color: var(--text);
}

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

.breakdown-table td strong {
    font-size: 14px;
    font-weight: 700;
}

@media (max-width: 768px) {
    .breakdown-panel {
        width: 100vw;
        max-width: 100vw;
        min-width: unset;
    }

    .breakdown-toggle-tab {
        padding: 10px 6px;
        font-size: 12px;
    }

    .breakdown-resize-handle {
        display: none;
    }
}

.breakdown-toggle-tab {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 298;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px 0 0 8px;
    padding: 14px 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 1px;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
}

.breakdown-toggle-tab:hover {
    background: var(--primary-dark);
    padding-right: 12px;
}

.breakdown-resize-handle {
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    cursor: ew-resize;
    z-index: 301;
    background: transparent;
    transition: background 0.2s;
}

.breakdown-resize-handle:hover {
    background: var(--primary);
}

.breakdown-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 2px solid var(--primary);
    background: var(--primary-light);
    flex-shrink: 0;
}

.breakdown-panel-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.breakdown-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.breakdown-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

@media print {
    .breakdown-panel,
    .breakdown-panel-overlay,
    .breakdown-panel-toggle,
    .breakdown-toggle-tab {
        display: none !important;
    }
}
