/* CSS Variables - Vercel/Geist Light Theme */
:root {
    --primary-color: #000000;
    --primary-hover: #333333;
    --secondary-color: #e5e5e5;
    --accent-color: #000000;
    --success-color: #16a34a;
    --success-hover: #15803d;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --text-color: #171717;
    --text-light: #737373;
    --bg-color: #ffffff;
    --bg-card: #fafafa;
    --bg-input: #ffffff;
    --sidebar-bg: #fafafa;
    --border-color: #e5e5e5;
    --input-bg: #ffffff;
    --card-bg: #fafafa;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    --panel-background: #fafafa;
    --input-background: #ffffff;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    color: #171717;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Cursor helpers */
#konvaContainer.cursor-pan {
    cursor: grab;
    cursor: -webkit-grab;
}

#konvaContainer.cursor-pan:active {
    cursor: grabbing;
    cursor: -webkit-grabbing;
}

#konvaContainer.cursor-draw {
    cursor: crosshair;
}

#transitionsCanvas {
    pointer-events: none !important;
}

/* Touch-friendly button sizes */
button,
.btn {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #ffffff;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #fafafa;
    color: #171717;
    border-bottom: 1px solid #e5e5e5;
    z-index: 1000;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.btn-back {
    background: transparent;
    border: 1px solid #e5e5e5;
    color: #171717;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-back:hover {
    background: #f2f2f2;
}

.header-logo {
    max-height: 60px;
    max-width: 300px;
    height: auto;
    width: auto;
    object-fit: contain;
}

.header-right {
    display: flex;
    gap: 12px;
}

/* Buttons */
.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    background: #f2f2f2;
    color: #a3a3a3;
}

.btn-primary {
    background: #000000;
    color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
    background: #333333;
}

.btn-secondary {
    background: #ffffff;
    color: #171717;
    border: 1px solid #e5e5e5;
}

.btn-secondary:hover:not(:disabled) {
    background: #f2f2f2;
    border-color: #d4d4d4;
}

.btn-warning {
    background: #d97706;
    color: #ffffff;
}

.btn-warning:hover:not(:disabled) {
    background: #b45309;
}

/* Customer Info Edit Styling */
.customer-info-edit {
    pointer-events: auto !important;
    z-index: 1000 !important;
    position: relative !important;
}

/* Force customer info form fields to be interactive */
#firstName,
#lastName,
#phoneNumber,
#address,
#email,
#projectNotes {
    pointer-events: auto !important;
    z-index: 1001 !important;
    position: relative !important;
    cursor: text !important;
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    background: white !important;
    color: black !important;
    border: 2px solid #000000 !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 40px !important;
    padding: 12px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    resize: none !important;
    overflow: visible !important;
    clip: auto !important;
    clip-path: none !important;
    mask: none !important;
    filter: none !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
}

/* Override any global blocking rules */
* {
    pointer-events: auto !important;
}

/* Ensure no element is blocking form fields */
body,
html,
.content,
.tab-content,
.customer-info-edit {
    pointer-events: auto !important;
}

/* Editable Field Styling */
.editable-field {
    width: 100%;
    padding: 12px;
    border: 2px solid #000000;
    border-radius: 6px;
    background: white;
    color: #000000;
    font-size: 14px;
    min-height: 20px;
    cursor: text;
    outline: none;
    transition: border-color 0.2s ease;
    pointer-events: auto !important;
    z-index: 1001 !important;
    position: relative !important;
}

.editable-field:focus {
    border-color: #333333;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.editable-field:empty:before {
    content: attr(data-placeholder);
    color: #a3a3a3;
    font-style: italic;
}

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

/* Simple Form Input Styling */
.simple-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: white;
    color: #000000;
    font-size: 14px;
    min-height: 20px;
    cursor: text;
    outline: none;
    transition: border-color 0.2s ease;
}

.simple-input:focus {
    border-color: #000000;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

.simple-input:empty:before {
    content: attr(data-placeholder);
    color: #a3a3a3;
    font-style: italic;
}

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

.btn-sm {
    padding: 8px 12px;
    font-size: 12px;
    min-height: 36px;
    min-width: 36px;
}

/* Make all button icons black */
.btn i,
.tool-btn i,
.zoom-btn i,
button i {
    color: inherit;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    background: #ffffff;
    color: #171717;
}

/* When home page is active, hide main content */
.home-page.active~.main-content,
.home-page.active+.main-content {
    display: none;
}

/* Boot-up Loading Screen */
.bootup-loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('Photos/new loading screen.png') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.bootup-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.logo-box {
    background: rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 40px 60px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.company-logo {
    max-width: 200px;
    max-height: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
    border: none;
    outline: none;
    box-shadow: none;
}

.fallback-logo {
    text-align: center;
}

.company-title {
    font-size: 42px;
    font-weight: bold;
    color: #2C2C2C;
    letter-spacing: 3px;
    margin-bottom: 8px;
}

.company-subtitle {
    font-size: 28px;
    font-weight: bold;
    color: #2C2C2C;
    letter-spacing: 2px;
}

.bootup-loading-spinner {
    font-size: 48px;
    color: rgba(255, 255, 255, 0.9);
}

.bootup-loading-bar {
    width: 300px;
    height: 18px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 9px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.bootup-loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 9px;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Project Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('Photos/new loading screen.png') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-screen.active {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    text-align: center;
    color: white;
    max-width: 400px;
    padding: 40px;
}

.loading-logo {
    margin-bottom: 30px;
}

.loading-logo-img {
    max-width: 300px;
    max-height: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.loading-spinner {
    font-size: 48px;
    margin-bottom: 20px;
    color: #fff;
}

.loading-content h2 {
    font-size: 24px;
    margin-bottom: 20px;
    font-weight: 300;
}

.loading-bar {
    width: 100%;
    height: 18px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 9px;
    overflow: hidden;
    margin-bottom: 15px;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 9px;
    width: 0%;
    transition: width 0.3s ease;
}

.loading-content p {
    font-size: 14px;
    opacity: 0.8;
    margin: 0;
}

/* Home Page */
.home-page {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    height: calc(100vh - 60px);
    padding: 30px;
    background: #ffffff;
    overflow: auto;
    z-index: 100;
}

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

/* Hide detail tools on home screen */
.home-page.active~.header .detail-tools,
.home-page.active+.header .detail-tools,
body:has(.home-page.active) .header .detail-tools {
    display: none !important;
}

/* Alternative approach - hide when home page is active */
.app-container:has(.home-page.active) .header .detail-tools {
    display: none !important;
}

.home-container {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.combined-section {
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    flex: 1;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.section-header {
    background: #fafafa;
    color: #171717;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.section-header .header-content {
    flex: 1;
}

.section-header h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 600;
}

.section-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

.combined-box {
    padding: 25px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.combined-box::-webkit-scrollbar {
    width: 6px;
}

.combined-box::-webkit-scrollbar-track {
    background: #fafafa;
    border-radius: 3px;
}

.combined-box::-webkit-scrollbar-thumb {
    background: #d4d4d4;
    border-radius: 3px;
}

.combined-box::-webkit-scrollbar-thumb:hover {
    background: #a3a3a3;
}

/* Project Cards (from Measure Pool / Checkout) */
.project-card {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.project-card:hover {
    border-color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

.project-card-title {
    font-weight: 600;
    color: #171717;
    font-size: 1.1em;
}

.project-badge {
    font-size: 0.7em;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.project-badge.checkout {
    background: rgba(0, 0, 0, 0.06);
    color: #171717;
}

.project-card-address {
    color: #737373;
    font-size: 0.9em;
    margin-bottom: 8px;
}

.project-card-date {
    color: #737373;
    font-size: 0.8em;
    opacity: 0.7;
}

.project-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.85em;
}

.project-card-meta i {
    margin-right: 4px;
    opacity: 0.7;
}

.project-card-status {
    display: flex;
    align-items: center;
}

.status-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-tag.pending {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.status-tag.assigned {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.status-tag.in-progress {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
}

.status-tag.checked-out {
    background: rgba(0, 0, 0, 0.2);
    color: #000000;
}

.status-tag.completed {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.project-card-actions {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.project-card-open-btn {
    flex: 1;
    padding: 10px 16px;
    background: #000000;
    border: none;
    border-radius: 6px;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.project-card-open-btn:hover {
    transform: scale(1.02);
    background: #333333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.project-card-delete-btn {
    padding: 10px 16px;
    background: #dc2626;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.project-card-delete-btn:hover {
    transform: scale(1.02);
    background: #b91c1c;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.project-card.checkout-card {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.project-card.checkout-card:hover {
    border-color: #000000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.project-card-address i {
    margin-right: 6px;
    opacity: 0.7;
}

.combined-box.dragover {
    background: #f0f8ff;
    border: 2px dashed #000000;
}

.pdf-box {
    padding: 25px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-items-message,
.no-projects-message,
.no-rooms-message,
.drop-zone {
    text-align: center;
    color: #666;
    padding: 40px 20px;
}

.no-items-message i,
.no-projects-message i,
.no-rooms-message i,
.drop-zone i {
    font-size: 32px;
    margin-bottom: 12px;
    color: #737373;
}

.no-items-message p,
.no-projects-message p,
.no-rooms-message p,
.drop-zone p {
    margin: 8px 0;
    font-size: 14px;
}

.drop-hint {
    font-size: 14px !important;
    color: #999 !important;
}

.drop-zone {
    border: 3px dashed #ddd;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.drop-zone:hover {
    border-color: #000000;
    background: #f8f9ff;
}

.drop-zone.dragover {
    border-color: #000000;
    background: #f0f4ff;
    transform: scale(1.02);
}

.home-page .project-item {
    background: #f0f4ff !important;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

.home-page .project-item:hover {
    border-color: #000000;
    background: #e8f0ff !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.home-page .project-item.pdf-item {
    background: #fff5f0 !important;
    border-color: #ff6b35;
}

.home-page .project-item.pdf-item:hover {
    background: #ffe8e0 !important;
    border-color: #ff6b35;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.2);
}

.home-page .project-item.pdf-item h3 i {
    color: #ff6b35;
    margin-right: 8px;
}

/* Existing Surfaces Tab Styles */
.existing-surfaces-list {
    max-height: 70vh;
    overflow-y: auto;
    padding: 20px;
}

.existing-surfaces-list::-webkit-scrollbar {
    width: 6px;
}

.existing-surfaces-list::-webkit-scrollbar-track {
    background: #fafafa;
    border-radius: 3px;
}

.existing-surfaces-list::-webkit-scrollbar-thumb {
    background: #d4d4d4;
    border-radius: 3px;
}

.existing-surfaces-list::-webkit-scrollbar-thumb:hover {
    background: #a3a3a3;
}

.room-surface-item {
    background: #fafafa;
    border: 2px solid #e5e5e5;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.room-surface-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f8f9fa;
}

.room-surface-header h3 {
    margin: 0;
    color: #000000;
    font-size: 20px;
    font-weight: 600;
}

.room-surface-header i {
    margin-right: 10px;
    color: #000000;
    font-size: 18px;
}

.room-surface-dropdowns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.room-surface-dropdown {
    display: flex;
    flex-direction: column;
}

.room-surface-dropdown label {
    color: #495057;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.room-surface-dropdown select {
    padding: 12px;
    border: 2px solid #e5e5e5;
    border-radius: 6px;
    background: #ffffff;
    color: #171717;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.room-surface-dropdown select:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

/* Excel Style Grid for Existing Surfaces */
/* The tab is a column: heading, scrollable room grid, then the apply section
   pinned at the bottom so it is always visible. */
#existing-surfaces-sub-panel .existing-surfaces-content {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 300px);
    max-height: calc(100vh - 300px);
    min-height: 420px;
    overflow: hidden;
}
#existing-surfaces-sub-panel .existing-surfaces-content h3 {
    flex: 0 0 auto;
}
.surfaces-hint {
    flex: 0 0 auto;
    margin: -6px 0 10px;
    color: #737373;
    font-size: 13px;
}
.surfaces-grid-container {
    flex: 1 1 auto;
    min-height: 140px;
    overflow: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    margin-bottom: 14px;
}

.surfaces-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    min-width: 800px;
    color: #000000 !important;
}

.grid-header {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    padding: 12px;
    font-weight: bold;
    color: #000000 !important;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.grid-header:last-child {
    border-right: none;
}

.grid-row {
    display: contents;
}

.grid-cell {
    border-bottom: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.grid-cell:last-child {
    border-right: none;
}

.grid-cell:hover {
    background-color: #f8f9fa;
}

.grid-cell.selected {
    background-color: #000000;
    color: white;
}

.grid-cell.room-name {
    font-weight: 500;
    color: #000000 !important;
    justify-content: flex-start;
}

.grid-cell.room-name.selected {
    color: white;
}

/* Plain text values; "Unspecified" is red until a value is applied */
.grid-cell .surface-value {
    color: #171717;
    font-size: 14px;
}
.grid-cell .surface-unspecified {
    color: #dc2626;
    font-weight: 600;
    font-size: 13px;
}

.room-name {
    display: flex;
    align-items: center;
    cursor: pointer;
}

/* Rows are the selection unit: hover lightly, selected rows go black */
.grid-row:hover .grid-cell {
    background-color: #f2f2f2;
}
.grid-row:focus-visible .grid-cell {
    outline: 2px solid #000;
    outline-offset: -2px;
}
.grid-row.room-selected .grid-cell {
    background-color: #000000 !important;
    border-color: #000000 !important;
    color: #ffffff !important;
}
.grid-row.room-selected .grid-cell.room-name,
.grid-row.room-selected .grid-cell .surface-value {
    color: #ffffff !important;
}
.grid-row.room-selected .grid-cell .surface-unspecified {
    color: #fca5a5 !important;
}

/* Furniture Room Checkbox Styling */
.furniture-room-item {
    display: flex;
    align-items: center;
    margin: 5px 0;
    padding: 8px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background: #ffffff;
    color: #171717;
}

.furniture-room-item label {
    color: #171717;
}

.furniture-room-checkbox {
    margin-right: 10px;
    transform: scale(1.2);
    cursor: pointer;
}

.furniture-room-label {
    cursor: pointer;
    margin: 0;
    flex: 1;
    color: #171717 !important;
    font-size: 14px;
}

/* Apply section (pinned under the room grid) */
.mass-edit-controls {
    flex: 0 0 auto;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 14px 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.surfaces-select-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.surfaces-selected-count {
    margin-left: auto;
    color: #737373;
    font-size: 13px;
    font-weight: 600;
}

.mass-edit-controls .control-row {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
    transition: opacity 0.15s ease;
}
/* Greyed out until at least one room is selected */
.mass-edit-controls .control-row.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.control-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 150px;
}

.control-section label {
    font-weight: 500;
    color: #000000 !important;
    font-size: 14px;
}

.control-section select {
    padding: 8px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background: #ffffff;
    color: #171717;
    font-size: 14px;
}

.control-section select:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

#applyMassEdit {
    margin-left: auto;
    padding: 10px 20px;
    font-size: 14px;
}

/* No rooms message in grid */
.surfaces-grid .no-rooms-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.surfaces-grid .no-rooms-message i {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

.surfaces-grid .no-rooms-message p {
    margin: 0;
    font-size: 16px;
}

/* Notes Tab Styles */
.notes-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 30px;
}

.notes-section {
    background: #fafafa;
    border: 2px solid #e5e5e5;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.notes-section h3 {
    color: #000000;
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid #f8f9fa;
    padding-bottom: 10px;
}

.notes-section textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    background: white;
    color: #495057;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.notes-section textarea:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.notes-section textarea::placeholder {
    color: #6c757d;
    font-style: italic;
}

.notes-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

.notes-actions .btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
}

/* Responsive design for notes */
@media (max-width: 768px) {
    .notes-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .notes-actions {
        flex-direction: column;
        align-items: center;
    }

    .notes-actions .btn {
        width: 200px;
    }
}

/* Photos Tab Styles - New Two-Panel Layout */
#photos-panel.active {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
}

.photos-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Left Panel - Room/Area Selector */
.photos-area-panel {
    width: 200px;
    min-width: 200px;
    background: #fafafa;
    border-right: 1px solid #e5e5e5;
    display: flex;
    flex-direction: column;
}

.photos-area-header {
    padding: 12px 15px;
    background: #fafafa;
    border-bottom: 1px solid #e5e5e5;
}

.photos-area-header h3 {
    margin: 0;
    color: #000000;
    font-size: 14px;
    font-weight: 600;
}

.photos-area-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    min-height: 0;
}

/* Scrollbar styling for area list */
.photos-area-list::-webkit-scrollbar {
    width: 6px;
}

.photos-area-list::-webkit-scrollbar-track {
    background: #ffffff;
}

.photos-area-list::-webkit-scrollbar-thumb {
    background: #e5e5e5;
    border-radius: 3px;
}

.photos-area-list::-webkit-scrollbar-thumb:hover {
    background: #000000;
}

.area-item {
    padding: 10px 15px;
    color: #171717;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 1px solid #f2f2f2;
    transition: all 0.15s ease;
}

.area-item:hover {
    background: #f2f2f2;
}

.area-item.selected {
    background: #e5e5e5;
    color: #000000;
    border-left: 3px solid #000000;
    padding-left: 12px;
}

.area-item.room-item {
    font-style: italic;
    color: #737373;
}

.photos-area-footer {
    padding: 12px 15px;
    border-top: 1px solid #e5e5e5;
    background: #fafafa;
}

.photos-apply-btn {
    width: 100%;
    padding: 10px 15px;
    background: #000000;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.photos-apply-btn:hover {
    background: #333333;
}

/* Right Panel - Photo Grid */
.photos-grid-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #fafafa;
}

.photos-grid-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    align-content: start;
}

/* Scrollbar styling for photo grid */
.photos-grid-container::-webkit-scrollbar {
    width: 8px;
}

.photos-grid-container::-webkit-scrollbar-track {
    background: #ffffff;
    border-radius: 4px;
}

.photos-grid-container::-webkit-scrollbar-thumb {
    background: #e5e5e5;
    border-radius: 4px;
}

.photos-grid-container::-webkit-scrollbar-thumb:hover {
    background: #000000;
}

/* Photo Card */
.photo-card {
    background: #fafafa;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e5e5e5;
    transition: all 0.2s ease;
    cursor: pointer;
    min-width: 150px;
    min-height: 180px;
}

.photo-card:hover {
    border-color: #d4d4d4;
}

.photo-card.selected {
    border-color: #000000;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
}

.photo-thumbnail {
    width: 100%;
    height: 140px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.photo-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-label-input {
    width: 100%;
    background: #ffffff;
    border: none;
    border-top: 1px solid #e5e5e5;
    padding: 10px 12px;
    color: #171717;
    font-size: 12px;
    text-align: center;
    box-sizing: border-box;
}

.photo-label-input:focus {
    outline: none;
    background: #fafafa;
    color: #000000;
}

.photo-label-input::placeholder {
    color: #555;
}

/* Bottom Bar */
.photos-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #fafafa;
    border-top: 1px solid #e5e5e5;
}

.photos-count {
    color: #171717;
    font-size: 13px;
}

.photos-count strong {
    color: #000000;
}

.photos-max-hint {
    color: #737373;
    margin-left: 8px;
}

.photos-action-buttons {
    display: flex;
    gap: 10px;
}

.photos-action-btn {
    padding: 8px 16px;
    background: #e5e5e5;
    color: #171717;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.photos-action-btn:hover:not(:disabled) {
    background: #f2f2f2;
    border-color: #000000;
    color: #000000;
}

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

.photos-action-btn i {
    font-size: 11px;
}

/* Photo Enlarge Modal */
.photo-enlarge-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-enlarge-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
}

.photo-enlarge-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.photo-enlarge-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.photo-enlarge-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 36px;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
    z-index: 1;
}

.photo-enlarge-close:hover {
    opacity: 1;
}

.photo-enlarge-label {
    margin-top: 16px;
    color: white;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
}

/* Empty state for photo grid */
.photos-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #555;
}

.photos-empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.photos-empty-state p {
    font-size: 14px;
    color: #737373;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .photos-grid-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .photos-grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .photos-layout {
        flex-direction: column;
    }
    
    .photos-area-panel {
        width: 100%;
        min-width: 100%;
        max-height: 150px;
        border-right: none;
        border-bottom: 1px solid #e5e5e5;
    }
    
    .photos-grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Estimate Sub-tabs */
.estimate-subtabs {
    display: flex;
    gap: 4px;
    padding: 12px 20px 0;
    background: var(--panel-background);
    border-bottom: 1px solid var(--border-color);
}

.subtab-btn {
    background: transparent;
    border: none;
    color: #737373;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.subtab-btn:hover {
    background: #e5e5e5;
    color: #171717;
}

.subtab-btn.active {
    background: #EDEDED;
    color: #171717;
}

.subtab-panel {
    display: none;
}

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

/* Cut Sheets Layout */
.cut-sheets-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--panel-background);
    border-bottom: 1px solid var(--border-color);
}

.cut-sheet-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cut-sheet-selector label {
    color: #737373;
    font-size: 14px;
    font-weight: 500;
}

.cut-sheet-select {
    min-width: 300px;
    padding: 8px 12px;
    background: var(--input-background);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: #171717;
    font-size: 14px;
}

.cut-sheets-layout {
    display: flex;
    height: calc(100vh - 230px);
    gap: 20px;
    padding: 20px;
    overflow-y: auto;
}

.seam-drawing-section {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--panel-background);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.seam-drawing-section h3 {
    color: #171717;
    margin-bottom: 16px;
    font-size: 18px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
}

.seam-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.seam-controls label {
    color: #737373;
    font-size: 14px;
}

.carpet-width-select {
    background: var(--input-background);
    border: 1px solid var(--border-color);
    color: #171717;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.seam-canvas-container {
    flex: 1;
    background: #f2f2f2;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#seamCanvas {
    max-width: 100%;
    max-height: 100%;
    cursor: pointer;
}

#seamCanvas:hover {
    cursor: crosshair;
}

.cut-column-section {
    width: 320px;
    display: flex;
    flex-direction: column;
    background: var(--panel-background);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.cut-column-section h3 {
    color: #171717;
    margin-bottom: 12px;
    font-size: 18px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
}

.cut-column-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #737373;
    font-size: 14px;
    margin-bottom: 16px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.roll-total {
    font-weight: 600;
    color: #95DB4F;
}

.carpet-roll-column {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    background: #f2f2f2;
    border-radius: 8px;
    min-height: 200px;
}

/* ===== FLOOR WIZARD STYLE CUT SHEETS ===== */

.cut-sheets-fw {
    display: flex;
    height: calc(100vh - 230px);
    background: #ffffff;
}

.cs-left-panel {
    width: 200px;
    background: #fafafa;
    border-right: 1px solid #e5e5e5;
    padding: 4px;
    display: flex;
    flex-direction: column;
}

.cs-section-header {
    background: #e5e5e5;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: bold;
    color: #171717;
    border: 1px solid #e5e5e5;
    margin-bottom: 4px;
}

.cs-flooring-list {
    flex: 1;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #d4d4d4;
}

.cs-flooring-item {
    padding: 4px 6px;
    font-size: 10px;
    cursor: pointer;
    border-bottom: 1px solid #e5e5e5;
    color: #171717;
}

.cs-flooring-item:hover {
    background: #e5e5e5;
}

.cs-flooring-item.selected {
    background: #000000;
    color: #ffffff;
}

/* One roll per flooring selection: roll number badge + room count */
.cs-flooring-item {
    display: flex;
    align-items: center;
    gap: 5px;
}
.cs-roll-num {
    flex: 0 0 auto;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    background: #d4d4d4;
    color: #171717;
    font-weight: 700;
    font-size: 9px;
    line-height: 16px;
    text-align: center;
}
.cs-flooring-item.selected .cs-roll-num {
    background: #95DB4F;
    color: #000000;
}
.cs-roll-rooms {
    margin-left: auto;
    font-size: 9px;
    opacity: 0.7;
    white-space: nowrap;
}

.cs-no-flooring {
    padding: 8px;
    font-size: 10px;
    color: #737373;
    text-align: center;
}

.cs-buttons-row {
    display: flex;
    gap: 2px;
    margin-top: 4px;
}

.cs-btn {
    flex: 1;
    padding: 4px;
    font-size: 10px;
    background: #e5e5e5;
    border: 1px solid #e5e5e5;
    cursor: pointer;
    color: #171717;
}

.cs-btn:hover {
    background: #000000;
    color: #ffffff;
}

/* Cut Pieces Chart Panel */
.cs-pieces-chart-panel {
    width: 220px;
    background: #fafafa;
    border-right: 1px solid #e5e5e5;
    padding: 4px;
    display: flex;
    flex-direction: column;
}

.cs-pieces-list {
    flex: 1;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #e5e5e5;
}

.cs-piece-row {
    padding: 4px 6px;
    font-size: 10px;
    color: #171717;
    border-bottom: 1px solid #e5e5e5;
    white-space: nowrap;
}

.cs-piece-letter {
    font-weight: bold;
    color: #000000;
}

.cs-piece-name {
    color: #737373;
    font-size: 9px;
}

.cs-piece-dims {
    color: #171717;
}

/* Split Tools Panel (between left and center) */
.cs-split-tools-panel {
    width: 100px;
    background: #fafafa;
    border-left: 1px solid #e5e5e5;
    border-right: 1px solid #e5e5e5;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cs-split-btn {
    padding: 6px 4px;
    font-size: 10px;
    background: #e5e5e5;
    border: 1px solid #e5e5e5;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: #171717;
}

.cs-split-btn:hover:not(:disabled) {
    background: #000000;
    color: #ffffff;
}

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

.cs-split-btn.cs-delete-btn {
    background: #ff6b6b;
    border-color: #cc4444;
    color: white;
}

.cs-split-btn.cs-delete-btn:hover:not(:disabled) {
    background: #ff4444;
}

.cs-split-btn.cs-allowance-btn {
    margin-top: 10px;
}

.cs-split-btn.cs-allowance-btn.active {
    background: #171717;
    border-color: #171717;
    color: #ffffff;
}

.cs-split-btn.cs-allowance-btn.active i {
    color: #95DB4F;
}

.cs-center-panel {
    width: 716px; /* 700px canvas + 8px padding + 8px border */
    display: flex;
    flex-direction: column;
    padding: 4px;
    background: #ffffff;
}

.cs-canvas-header {
    background: #e5e5e5;
    padding: 4px 8px;
    font-size: 11px;
    color: #171717;
    color: #333;
    border: 1px solid #d4d4d4;
    margin-bottom: 4px;
}

.cs-canvas-container {
    flex: 1;
    background: #ffffff; /* White per user request */
    border: 1px solid #d4d4d4;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

/* Canvas should NOT stretch - maintain pixel-perfect dimensions */
.cs-canvas-container canvas {
    /* Remove width/height 100% to prevent stretching */
    /* Canvas will be its natural size (set in JS) */
}

.cs-right-panel {
    width: 240px; /* Increased from 180px per user request */
    background: #fafafa;
    border-left: 1px solid #e5e5e5;
    padding: 4px;
    display: flex;
    flex-direction: column;
}

/* Wider right panel option */
.cs-right-panel.cs-right-wider {
    width: 280px;
}

.cs-roll-visual {
    flex: 1;
    background: #fff;
    border: 1px solid #d4d4d4;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px;
    min-height: 150px;
    margin-bottom: 4px;
    /* Remove flex to allow proper scrolling of tall content */
}

.cs-no-pieces {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #a3a3a3;
    font-size: 11px;
}

.cs-no-pieces i {
    font-size: 24px;
    margin-bottom: 8px;
}

.cs-roll-table {
    background: #fafafa;
    border: 1px solid #e5e5e5;
    font-size: 10px;
}

.cs-table-header {
    display: flex;
    background: #e5e5e5;
    border-bottom: 1px solid #e5e5e5;
    font-weight: bold;
    color: #171717;
}

.cs-table-header span,
.cs-table-row span {
    padding: 3px 4px;
    border-right: 1px solid #e5e5e5;
}

.cs-table-header span:last-child,
.cs-table-row span:last-child {
    border-right: none;
}

.cs-col-roll { width: 30px; }
.cs-col-len { width: 50px; }
.cs-col-cuts { flex: 1; }

.cs-table-body {
    max-height: 120px;
    overflow-y: auto;
}

.cs-table-row {
    display: flex;
    border-bottom: 1px solid #e5e5e5;
    cursor: pointer;
    color: #171717;
}

.cs-table-row:hover {
    background: #e5e5e5;
}

.cs-table-row.selected {
    background: #000000;
    color: #ffffff;
}

/* Estimate table: per-roll footer under carpet / sheet vinyl sections */
.roll-summary-table {
    margin-top: 4px;
}
.roll-summary-table th {
    font-size: 10px;
    opacity: 0.85;
}

.cs-total-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 8px;
    background: #e5e5e5;
    color: #171717;
    border: 1px solid #d4d4d4;
    margin-top: 4px;
    font-size: 11px;
    font-weight: bold;
}

/* Cut piece styling - BLUE instead of orange */
.cs-cut-piece {
    background: #4A90D9;
    border: 1px solid #2E6AB0;
    padding: 4px 6px;
    color: white;
    font-size: 10px;
    cursor: pointer;
    position: relative;
}

.cs-cut-piece:hover {
    background: #5A9FE8;
}

.cs-cut-piece.highlighted {
    background: #FF6B6B;
    border-color: #CC4444;
}

.cs-cut-piece-label {
    font-weight: bold;
}

.cs-cut-piece-size {
    font-size: 9px;
    opacity: 0.9;
}

/* Legacy cut piece - updated to blue */
.cut-piece {
    background: #4A90D9;
    border: 2px solid #2E6AB0;
    border-radius: 6px;
    padding: 12px;
    color: white;
    cursor: grab;
    transition: all 0.2s ease;
    position: relative;
}

.cut-piece.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.cut-piece-visual {
    background: rgba(0, 102, 255, 0.4);
    border: 1px dashed #0066FF;
    border-radius: 4px;
    margin-bottom: 8px;
    min-height: 30px;
    position: relative;
}

.cut-piece-fill {
    background: #0066FF;
    border-radius: 3px;
    height: 100%;
    min-height: 30px;
}

.cut-piece-pattern {
    font-size: 10px;
    color: #95DB4F;
    margin-top: 4px;
}

.cut-piece:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.cut-piece.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color);
}

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

.cut-piece-room {
    font-weight: 600;
    font-size: 14px;
}

.cut-piece-id {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

.cut-piece-dimensions {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.cut-piece-area {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.cut-piece-splits {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
}

.no-pieces-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.no-pieces-message i {
    font-size: 36px;
    margin-bottom: 12px;
    display: block;
}

.no-pieces-message p {
    font-size: 14px;
}

/* Product dropdown for cut pieces column */
.cut-pieces-product-dropdown {
    margin-bottom: 12px;
}

.cut-pieces-product-dropdown select {
    width: 100%;
    padding: 10px 12px;
    background: var(--input-background);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: #171717;
    font-size: 14px;
    cursor: pointer;
}

.cut-pieces-product-dropdown select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Tetris-style stacking container */
.tetris-stack-container {
    position: relative;
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 2px dashed var(--border-color);
    border-radius: 6px;
    min-height: 400px;
    /* Let parent container handle scrolling for 40ft buffer */
    overflow: visible;
}

.tetris-roll-width-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: rgba(149, 219, 79, 0.2);
    border-bottom: 1px solid var(--primary-color);
    display: flex;
    justify-content: space-between;
    padding: 2px 8px;
    font-size: 10px;
    color: #95DB4F;
}

.tetris-piece {
    position: absolute;
    background: #4A90D9; /* Blue instead of brown/orange */
    border: 2px solid #2E6AB0;
    border-radius: 4px;
    padding: 6px;
    cursor: grab;
    transition: box-shadow 0.2s, border-color 0.2s, background 0.2s;
    box-sizing: border-box;
    overflow: hidden;
}

.tetris-piece:hover {
    border-color: #5A9FE8;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.tetris-piece.dragging {
    opacity: 0.7;
    cursor: grabbing;
    z-index: 100;
}

.tetris-piece.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.tetris-piece.highlighted {
    background: #FF6B6B !important;
    border-color: #CC4444 !important;
    box-shadow: 0 0 8px rgba(255, 107, 107, 0.6);
}

/* Polygon pieces - selection via SVG stroke, not rectangular border */
.tetris-piece.polygon-piece {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.tetris-piece.polygon-piece:hover {
    box-shadow: none !important;
}

.tetris-piece.polygon-piece.selected,
.tetris-piece.polygon-piece.highlighted {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Drag clone for pieces being moved */
.tetris-piece.drag-clone {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    cursor: grabbing !important;
}

.tetris-piece-label {
    font-size: 10px;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tetris-piece-dimensions {
    font-size: 11px;
    font-weight: 600;
    color: white;
}

/* Canvas piece menu - fixed left position */
.canvas-piece-menu {
    position: fixed;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: 16px;
    z-index: 10001;
    min-width: 200px;
}

.canvas-piece-menu h4 {
    margin: 0 0 12px 0;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.canvas-piece-menu-info {
    color: #666;
    font-size: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.canvas-piece-menu-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.canvas-piece-menu-actions button {
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f5f5f5;
    color: #333;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.canvas-piece-menu-actions button:hover {
    background: #e5e5e5;
    border-color: var(--primary-color);
}

.canvas-piece-menu-actions button.primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.canvas-piece-menu-actions button.primary:hover {
    opacity: 0.9;
}

.canvas-piece-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
}

/* Split controls modal */
.split-controls-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.split-controls-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.split-controls-content {
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 320px;
    border: 1px solid #ddd;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.split-controls-content h4 {
    color: #333;
    margin-bottom: 20px;
    font-size: 18px;
}

.split-option-group {
    margin-bottom: 16px;
}

.split-option-group label {
    display: block;
    color: #333;
    font-size: 14px;
    margin-bottom: 8px;
}

.split-direction-btns {
    display: flex;
    gap: 8px;
}

.split-direction-btns button {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    color: #333;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.split-direction-btns button:hover {
    border-color: #000000;
    background: #e5e5e5;
}

.split-direction-btns button.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.split-parts-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.split-parts-btns button {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    color: #333;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.split-parts-btns button:hover {
    border-color: #000000;
    background: #e5e5e5;
}

.split-parts-btns button.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.split-controls-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.split-controls-actions button {
    flex: 1;
    padding: 12px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

/* Split parts dialog (for Split H/V buttons) */
.split-parts-dialog-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.split-parts-dialog-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.split-parts-dialog {
    position: relative;
    background: #ffffff;
    border-radius: 8px;
    padding: 24px;
    min-width: 280px;
    border: 1px solid #e5e5e5;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    color: #171717;
}

.split-parts-dialog h4 {
    margin: 0 0 16px 0;
    font-size: 18px;
    color: #171717;
}

.split-parts-dialog-info {
    color: #737373;
    font-size: 13px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.split-parts-dialog-label {
    color: #171717;
    font-size: 14px;
    margin-bottom: 12px;
}

.split-parts-options {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.split-parts-btn {
    width: 50px;
    height: 50px;
    border: 1px solid #e5e5e5;
    background: #fafafa;
    color: #171717;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.2s;
}

.split-parts-btn:hover {
    border-color: var(--primary-color);
    background: rgba(149, 219, 79, 0.1);
}

.split-parts-btn.selected {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

.split-parts-actions {
    display: flex;
    gap: 12px;
}

.split-cancel-btn {
    flex: 1;
    padding: 12px;
    border: 1px solid #d4d4d4;
    background: #f5f5f5;
    color: #171717;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.split-cancel-btn:hover {
    background: #e5e5e5;
}

.split-confirm-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: var(--primary-color);
    color: #ffffff;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.split-confirm-btn:hover {
    opacity: 0.9;
}

/* Canvas drag ghost for piece dragging */
.canvas-drag-ghost {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.drag-ghost-label {
    font-weight: 600;
    margin-bottom: 4px;
}

.drag-ghost-dims {
    font-size: 10px;
    opacity: 0.8;
}

/* Estimate Summary Tab Styles */
.estimate-summary-layout {
    display: flex;
    height: calc(100vh - 120px);
    gap: 20px;
    padding: 20px;
}

.summary-canvas-section {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.summary-canvas-section h3 {
    color: #171717;
    margin-bottom: 0;
    font-size: 18px;
}

.summary-canvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
}

.summary-zoom-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.zoom-btn {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    color: #171717;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.zoom-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.zoom-level {
    color: #737373;
    font-size: 12px;
    min-width: 45px;
    text-align: center;
}

.canvas-hint {
    color: #666;
    font-size: 12px;
    text-align: center;
    margin-top: 8px;
}

/* Carpet Direction Popup */
.carpet-direction-popup {
    position: fixed;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    min-width: 200px;
    overflow: hidden;
}

.carpet-direction-popup .popup-header {
    padding: 12px 16px;
    background: #f5f5f5;
    color: #000000;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid #ddd;
}

.carpet-direction-popup .popup-subheader {
    padding: 8px 16px 4px;
    color: #666666;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.carpet-direction-popup .popup-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: #000000;
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.carpet-direction-popup .popup-option:hover {
    background: #e8f4fc;
}

.carpet-direction-popup .popup-option i {
    width: 16px;
    text-align: center;
    color: #000000;
}

.carpet-direction-popup .popup-divider {
    border: none;
    border-top: 1px solid #ddd;
    margin: 0;
}

.carpet-direction-popup .popup-option.apply-all {
    color: #666666;
    font-size: 13px;
}

.carpet-direction-popup .popup-option.apply-all:hover {
    color: #000000;
    background: #e8f4fc;
}

.carpet-direction-popup .popup-option.popup-cancel {
    color: #cc0000;
    font-weight: 600;
}

.carpet-direction-popup .popup-option.popup-cancel i {
    color: #cc0000;
}

.carpet-direction-popup .popup-option.popup-cancel:hover {
    background: #fdecec;
}

/* Pattern Match Popup */
.pattern-match-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 25, 47, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
}

.pattern-match-popup {
    background: #fafafa;
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    min-width: 320px;
    max-width: 400px;
    overflow: hidden;
}

/* Quote line item picker (reuses the pattern popup shell) */
.quote-line-popup { max-width: 460px; width: min(460px, 92vw); }
.quote-line-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 46vh;
    overflow-y: auto;
    margin: 0 0 18px 0;
}
.quote-line-option {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas: "radio name" "radio meta";
    column-gap: 10px;
    row-gap: 2px;
    align-items: center;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
}
.quote-line-option:hover { border-color: #bdbdbd; }
.quote-line-option.selected { border-color: #14b8a6; box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.2); }
.quote-line-option input { grid-area: radio; margin: 0; accent-color: #14b8a6; }
.quote-line-option .quote-line-name { grid-area: name; color: #171717; font-weight: 600; font-size: 14px; }
.quote-line-option .quote-line-meta { grid-area: meta; color: #737373; font-size: 12px; }

.pattern-popup-header {
    padding: 16px 20px;
    background: #f2f2f2;
    border-bottom: 1px solid #e5e5e5;
}

.pattern-popup-header h3 {
    margin: 0;
    color: #171717;
    font-size: 18px;
    font-weight: 600;
}

.pattern-popup-body {
    padding: 24px 20px;
    background: #fafafa;
}

.pattern-popup-body p {
    margin: 0 0 20px 0;
    color: #737373;
    font-size: 15px;
    text-align: center;
}

.pattern-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.pattern-buttons .btn {
    min-width: 100px;
    padding: 10px 24px;
    font-size: 14px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Yes button - teal accent */
#patternYesBtn,
#patternApplyBtn {
    background: #000000 !important;
    border: none !important;
    color: #ffffff !important;
}

#patternYesBtn:hover,
#patternApplyBtn:hover {
    background: #333333 !important;
}

/* No and Back buttons - muted style */
#patternNoBtn,
#patternBackBtn {
    background: #e5e5e5 !important;
    border: none !important;
    color: #737373 !important;
}

#patternNoBtn:hover,
#patternBackBtn:hover {
    background: #f2f2f2 !important;
    color: #171717 !important;
}

.pattern-inputs {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

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

.pattern-input-group label {
    min-width: 60px;
    color: #737373;
    font-size: 14px;
    font-weight: 600;
}

.pattern-input-group input {
    width: 80px;
    padding: 8px 12px;
    background: #ffffff;
    border: 2px solid #e5e5e5;
    border-radius: 6px;
    color: #171717;
    font-size: 16px;
    text-align: center;
}

.pattern-input-group input:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2);
}

.pattern-step-btn {
    width: 36px;
    height: 36px;
    border: 2px solid #e5e5e5;
    border-radius: 6px;
    background: #f7f7f7;
    color: #171717;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
}

.pattern-step-btn:hover {
    background: #eeeeee;
    border-color: #cccccc;
}

.pattern-step-btn:active {
    background: #e0e0e0;
}

.pattern-input-group span {
    color: #666;
    font-size: 14px;
}

.summary-canvas-container {
    flex: 1;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#summaryCanvas {
    border: 1px solid #ddd;
    border-radius: 6px;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.summary-calculations-panel {
    width: 400px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.calculations-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.calculations-content::-webkit-scrollbar {
    width: 8px;
}

.calculations-content::-webkit-scrollbar-track {
    background: #ffffff;
    border-radius: 4px;
}

.calculations-content::-webkit-scrollbar-thumb {
    background: #e5e5e5;
    border-radius: 4px;
}

.calculations-content::-webkit-scrollbar-thumb:hover {
    background: #000000;
}

.summary-calculations-section,
.summary-charges-section,
.summary-transitions-section,
.summary-notes-section {
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.summary-calculations-section h3,
.summary-charges-section h3,
.summary-transitions-section h3,
.summary-notes-section h3 {
    color: #000000;
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #f8f9fa;
    padding-bottom: 8px;
}

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

.calculation-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
}

.calculation-item h4 {
    margin: 0 0 8px 0;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
}

.calculation-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
}

.calculation-details span {
    color: #6c757d;
}

.calculation-details .value {
    font-weight: 600;
    color: #495057;
}

.total-summary {
    border-top: 1px solid #e9ecef;
    padding-top: 15px;
    margin-top: 15px;
}

.total-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f8f9fa;
    font-size: 14px;
}

.total-item:last-child {
    border-bottom: none;
}

.total-item.total-final {
    border-top: 1px solid #000000;
    margin-top: 8px;
    padding-top: 12px;
    font-weight: 600;
    font-size: 15px;
}

.total-label {
    color: #495057;
    font-weight: 500;
}

.total-value {
    color: #000000;
    font-weight: 600;
    font-size: 16px;
}

.charges-list,
.transitions-list {
    margin-bottom: 15px;
}

.charge-item,
.transition-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 13px;
}

.charge-item:last-child,
.transition-item:last-child {
    margin-bottom: 0;
}

.charge-name,
.transition-name {
    color: #171717;
    font-weight: 500;
}

.charge-value {
    color: #000000;
    font-weight: 600;
}

.transition-details {
    color: #6c757d;
    font-size: 14px;
}

.notes-list {
    margin-bottom: 20px;
}

.notes-list .note-item {
    display: flex;
    align-items: flex-start;
    padding: 10px 15px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 10px;
}

.notes-list .note-item:last-child {
    margin-bottom: 0;
}

.notes-list .note-text {
    color: #000000;
    font-size: 14px;
    line-height: 1.4;
}

/* Discount Section */
.discount-section {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.discount-title {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 8px;
}

.discount-controls {
    margin-bottom: 10px;
}

.discount-controls label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

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

.discount-input-group input {
    width: 80px;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.percentage-symbol {
    font-weight: 600;
    color: #495057;
    font-size: 16px;
}

.discount-input-group button {
    padding: 8px 16px;
    font-size: 14px;
}

.discount-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    background: #e8f5e8;
    border: 1px solid #28a745;
    border-radius: 4px;
    margin-top: 10px;
}

.discount-applied {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.discount-label {
    font-weight: 600;
    color: #155724;
}

.discount-value {
    font-weight: 700;
    color: #28a745;
}

.discount-info .btn {
    align-self: flex-end;
    padding: 6px 12px;
    font-size: 12px;
    color: #000000 !important;
}

.final-total-section {
    background: #000000;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin-top: 15px;
}

.final-total {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.final-label {
    color: white;
    font-size: 18px;
    font-weight: 600;
}

.final-value {
    color: white;
    font-size: 24px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Charges Two-Box System Styles */
.charges-two-box-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
    flex: 1;
    min-height: 0;
}

.charges-left-box,
.charges-right-box {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.charges-left-box h3,
.charges-right-box h3 {
    color: #000000;
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid #f8f9fa;
    padding-bottom: 10px;
}

.line-items-list,
.applied-charges-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px;
    background: #f8f9fa;
}

.applied-charge-item {
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    min-height: 120px;
}

.applied-charge-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 15px;
    width: 100%;
}

.applied-charge-title {
    font-weight: bold;
    color: #171717;
    flex: 1;
}

.applied-charge-amount {
    font-weight: bold;
    color: #000000;
    font-size: 16px;
    margin-left: auto;
}

.applied-charge-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 10px;
}

.applied-charge-actions {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    margin-bottom: 15px;
    width: 100%;
    justify-content: space-between;
    align-items: flex-start;
}

.quantity-input-container {
    display: flex;
    align-items: center;
    gap: 5px;
}

.quantity-label {
    font-weight: bold;
    color: #333;
    font-size: 16px;
}

.quantity-input {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.quantity-input:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.button-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: auto;
}

.charge-note-display {
    margin-top: 10px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-left: 3px solid #000000;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
}

.applied-note-display {
    padding: 8px 12px;
    background: #e8f4fd;
    border: 1px solid #000000;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    font-style: italic;
}

.applied-charge-notes {
    margin-top: 8px;
    width: 100%;
}

.notes-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 5px;
    background: #ffffff;
    color: #171717;
}

.apply-notes-btn {
    background: #000000;
    color: #ffffff;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
    min-width: 80px;
    width: 100%;
    pointer-events: auto;
}

.apply-notes-btn:hover {
    background: #5a6268;
}

.charge-note {
    background: #e9ecef;
    padding: 8px;
    border-radius: 4px;
    font-size: 14px;
    color: #495057;
    margin-top: 5px;
    font-style: italic;
}

.line-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.line-item:hover {
    background: #e3f2fd;
    border-color: #000000;
}

.line-item.selected {
    background: #000000;
    color: white;
    border-color: #5a6fd8;
}

.line-item:last-child {
    margin-bottom: 0;
}

.line-item-checkbox {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.line-item-content {
    flex: 1;
}

.line-item-name {
    font-weight: 600;
    color: #495057;
    margin-bottom: 4px;
}

.line-item.selected .line-item-name {
    color: white;
}

.line-item-description {
    font-size: 14px;
    color: #6c757d;
}

.line-item.selected .line-item-description {
    color: rgba(255, 255, 255, 0.8);
}

.line-item-amount {
    font-weight: 600;
    color: #000000;
    font-size: 16px;
}

.line-item.selected .line-item-amount {
    color: white;
}

.apply-charges-btn {
    width: 100%;
    background: #000000;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.apply-charges-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.apply-charges-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.applied-charge-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    margin-bottom: 8px;
}

.applied-charge-item:last-child {
    margin-bottom: 0;
}

.applied-charge-name {
    color: #171717;
    font-weight: 500;
}

.applied-charge-amount {
    color: #000000;
    font-weight: 600;
}

.remove-charge-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
    min-width: 80px;
    width: 100%;
    pointer-events: auto;
}

.remove-charge-btn:hover {
    background: #c82333;
}

.applied-charges-total {
    border-top: 2px solid #e9ecef;
    padding-top: 20px;
    margin-top: 20px;
}

.applied-charges-total .total-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 18px;
    font-weight: 600;
}

.applied-charges-total .total-label {
    color: #495057;
}

.applied-charges-total .total-value {
    color: #000000;
    font-size: 20px;
}

/* Responsive design for charges */
@media (max-width: 768px) {
    .charges-two-box-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Notes Two-Box System Styles */
.notes-two-box-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
    flex: 1;
    min-height: 0;
}

.notes-left-box,
.notes-right-box {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.notes-left-box {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.notes-left-box h3,
.notes-right-box h3 {
    color: #000000;
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid #f8f9fa;
    padding-bottom: 10px;
}

.predefined-notes-list {
    flex: 1 1 auto;
    min-height: 80px;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px;
    background: #f8f9fa;
    margin-bottom: 10px;
}

.applied-notes-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px;
    background: #f8f9fa;
    margin-bottom: 20px;
}

.note-item {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.note-item:hover {
    background: #e3f2fd;
    border-color: #000000;
}

.note-item.selected {
    background: #000000;
    color: white;
    border-color: #5a6fd8;
}

.note-item:last-child {
    margin-bottom: 0;
}

.note-checkbox {
    margin-right: 12px;
    margin-top: 2px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.note-content {
    flex: 1;
}

.note-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 4px;
    font-size: 14px;
}

.note-item.selected .note-title {
    color: white;
}

.note-content-wrapper {
    flex: 1;
    min-width: 0;
}

.note-text {
    font-size: 13px;
    color: #495057;
    line-height: 1.4;
}

.note-item.selected .note-text {
    color: rgba(255, 255, 255, 0.8);
}

.custom-note-input {
    border-top: 2px solid #e9ecef;
    padding-top: 8px;
    margin-top: 8px;
    flex-shrink: 0;
}

.custom-note-input h4 {
    color: #495057;
    margin: 0 0 6px 0;
    font-size: 12px;
    font-weight: 600;
}

.note-category-dropdown {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 11px;
    font-family: inherit;
    background: white;
    margin-bottom: 6px;
    box-sizing: border-box;
    cursor: pointer;
}

.note-category-dropdown:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.custom-note-input textarea {
    width: 100%;
    height: 40px;
    padding: 4px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 11px;
    font-family: inherit;
    resize: none;
    margin-bottom: 6px;
    box-sizing: border-box;
}

.custom-note-input textarea:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.add-custom-note-btn {
    width: 100%;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: not-allowed;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.add-custom-note-btn.enabled {
    background: #28a745;
    cursor: pointer;
}

.add-custom-note-btn.enabled:hover {
    background: #218838;
    transform: translateY(-1px);
}

.add-custom-note-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

.apply-notes-btn {
    width: 100%;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: not-allowed;
    margin-top: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex-shrink: 0;
}

.apply-notes-btn.enabled {
    background: #000000;
    cursor: pointer;
}

.apply-notes-btn.enabled:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.apply-notes-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.apply-notes-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.applied-note-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 15px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 8px;
}

.applied-note-item:last-child {
    margin-bottom: 0;
}

.applied-note-content {
    flex: 1;
}

.applied-note-title {
    color: #000000;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
}

.applied-note-text {
    color: #000000;
    font-size: 13px;
    line-height: 1.4;
}

/* Color-coded note categories */
.note-category-bullet {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    margin-top: 2px;
    vertical-align: top;
}

.note-category-bullet.note-category-unspecified {
    background-color: #6c757d;
}

.note-category-bullet.note-category-install-company {
    background-color: #28a745;
}

.note-category-bullet.note-category-customer-responsibility {
    background-color: #dc3545;
}

.note-category-bullet.note-category-store-associate {
    background-color: #000000;
}

.note-category-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 2px;
    color: #6c757d;
}

.remove-note-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 10px;
    transition: background 0.2s ease;
}

.remove-note-btn:hover {
    background: #c82333;
}

.notes-actions {
    border-top: 2px solid #e9ecef;
    padding-top: 20px;
    margin-top: 20px;
    display: flex;
    gap: 15px;
}

.notes-actions .btn {
    flex: 1;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.notes-actions .btn-primary {
    background: #000000;
    color: #ffffff;
    border: none;
}

.notes-actions .btn-primary:hover {
    background: #333333;
    transform: translateY(-1px);
}

.notes-actions .btn-secondary {
    background: #e5e5e5;
    color: #171717;
    border: none;
}

.notes-actions .btn-secondary:hover {
    background: #f2f2f2;
    transform: translateY(-1px);
}

/* Responsive design for notes */
@media (max-width: 768px) {
    .notes-two-box-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

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

/* Responsive design for estimate summary */
@media (max-width: 768px) {
    .estimate-summary-layout {
        flex-direction: column;
        height: auto;
        gap: 15px;
        padding: 15px;
    }

    .summary-canvas-section {
        order: 2;
        min-height: 300px;
    }

    .summary-calculations-panel {
        width: 100%;
        order: 1;
        max-height: 400px;
    }

    .summary-canvas-container {
        padding: 10px;
    }

    #summaryCanvas {
        max-height: 250px;
    }
}

/* Ensure delete button text and icon are black */
.home-page .btn-delete {
    color: #000000 !important;
}

/* Site Info Sub-tabs Styles */
.sub-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e5e5e5;
    padding-bottom: 10px;
}

.sub-tab-btn {
    background: #fafafa;
    border: 2px solid #e5e5e5;
    border-radius: 8px 8px 0 0;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #737373;
    border-bottom: none;
}

.sub-tab-btn:hover {
    background: #e5e5e5;
    border-color: #e5e5e5;
    color: #171717;
}

.sub-tab-btn.active {
    background: #ffffff;
    border-color: #000000;
    color: #000000;
    font-weight: 600;
    border-bottom: 2px solid #ffffff;
    margin-bottom: -2px;
}

.sub-tab-btn i {
    font-size: 16px;
}

.sub-tab-panel {
    display: none;
}

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

.furniture-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: #737373;
    background: #fafafa;
    border: 2px dashed #e5e5e5;
    border-radius: 10px;
    margin-top: 20px;
}

.furniture-placeholder i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #adb5bd;
}

.furniture-placeholder p {
    font-size: 16px;
    margin: 0;
}

/* Furniture Moving Three-Box Layout */
.furniture-three-box-container {
    display: grid;
    grid-template-columns: 0.6fr 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
    margin-left: 20px;
    margin-right: 20px;
    height: calc(100vh - 300px);
}

.furniture-left-box,
.furniture-middle-box,
.furniture-right-box {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.furniture-left-box h4,
.furniture-middle-box h4,
.furniture-right-box h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.rooms-list {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
    background: #ffffff;
    min-height: 300px;
}

.rooms-list .room-item {
    padding: 12px 15px;
    border-bottom: 1px solid #e5e5e5;
    cursor: pointer !important;
    transition: all 0.2s ease;
    font-weight: 500;
    color: white;
    color: #171717;
    user-select: none;
    pointer-events: auto !important;
    position: relative;
    z-index: 10;
}

.rooms-list .room-item:hover {
    background: #e5e5e5;
}

.rooms-list .room-item.selected {
    background: #000000;
    color: #ffffff;
    font-weight: 600;
}

.rooms-list .room-item:last-child {
    border-bottom: none;
}

.furniture-items-list {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
    background: #ffffff;
    min-height: 300px;
}

.furniture-item {
    padding: 12px 15px;
    border-bottom: 1px solid #e5e5e5;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
}

.furniture-item:hover {
    background: #e5e5e5;
}

.furniture-item.selected {
    background: #28a745;
    color: white;
}

.furniture-item:last-child {
    border-bottom: none;
}

.furniture-item-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.furniture-item-content span {
    color: #171717;
}

.furniture-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: #171717;
}

.furniture-cost {
    font-weight: 600;
    color: #171717;
    font-size: 14px;
}

.assigned-furniture-list {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    background: #f8f9fa;
    margin-bottom: 15px;
    min-height: 200px;
    max-height: 300px;
}

.assigned-room-group {
    margin-bottom: 15px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    background: white;
}

.assigned-room-header {
    background: #000000;
    color: white;
    padding: 10px 15px;
    font-weight: 600;
    font-size: 14px;
    border-radius: 5px 5px 0 0;
}

.assigned-furniture-items {
    padding: 10px;
}

.assigned-furniture-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin-bottom: 5px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.assigned-furniture-item:last-child {
    margin-bottom: 0;
}

.assigned-furniture-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #495057;
}

.assigned-furniture-name i {
    font-size: 14px;
    width: 16px;
    text-align: center;
}

/* Per-item delete: a quiet grey trash can the same size as the row text */
.remove-furniture-btn {
    background: transparent;
    color: #9ca3af;
    border: none;
    border-radius: 3px;
    padding: 0 2px;
    cursor: pointer;
    font-size: inherit;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s ease;
}

.remove-furniture-btn i { font-size: 1em; }

.remove-furniture-btn:hover {
    color: #6b7280;
}

.furniture-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.furniture-actions .btn {
    flex: 1;
    padding: 10px;
    font-size: 14px;
    font-weight: 500;
}

.no-rooms-message,
.no-assignments {
    padding: 20px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
    background: #f8f9fa;
    border: 1px dashed #dee2e6;
    border-radius: 5px;
    margin: 10px;
}

/* Responsive Design for Furniture Moving */
@media (max-width: 768px) {
    .furniture-three-box-container {
        grid-template-columns: 1fr;
        gap: 15px;
        height: auto;
    }

    .furniture-left-box,
    .furniture-middle-box,
    .furniture-right-box {
        min-height: 200px;
    }
}

.home-page .btn-delete:hover {
    color: #000000 !important;
}

.home-page .btn-delete span,
.home-page .btn-delete i {
    color: #000000 !important;
}

/* Target the specific delete button in project items */
.home-page .btn-danger.btn-sm {
    color: #000000 !important;
}

.home-page .btn-danger.btn-sm span,
.home-page .btn-danger.btn-sm i {
    color: #000000 !important;
}

/* Stairs Configuration Popup Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 500px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
}

.popup-header {
    background: #4a90e2;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-header h3 {
    margin: 0;
    font-size: 18px;
}

.close-popup {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-popup:hover {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.popup-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.stairs-config-grid {
    display: grid;
    gap: 15px;
}

.config-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 10px;
    align-items: center;
}

.config-row label {
    font-weight: 700;
    color: #171717 !important;
    text-align: right;
    padding-right: 10px;
    font-size: 16px;
    background: transparent;
    border: none;
    display: block;
    min-width: 100px;
}

.config-row select,
.config-row input {
    padding: 8px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    font-size: 14px;
    background: #ffffff;
    color: #171717;
}

.config-row select:focus,
.config-row input:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.popup-footer {
    background: #f8f9fa;
    padding: 15px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-cancel,
.btn-done {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
    position: relative;
    z-index: 10000;
    pointer-events: auto;
}

.btn-cancel {
    background: #ffffff;
    color: #dc2626;
    border-color: #dc2626;
}

.btn-cancel:hover {
    background: #dc2626;
    color: #ffffff;
}

.btn-done {
    background: #ffffff;
    color: #16a34a;
    border-color: #16a34a;
}

.btn-done:hover {
    background: #16a34a;
    color: #ffffff;
}

/* Enhanced Stairs Configuration Popup Styles */
.stairs-popup-content {
    background: #171717;
    border-radius: 0px;
    box-shadow: none;
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.stairs-popup-header {
    background: #1a1a1a;
    color: #fafafa;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
}

.stairs-popup-header h3 {
    margin: 0;
    font-size: 18px;
    color: #fafafa;
}

.stairs-popup-header .close-popup {
    color: #a3a3a3;
}

.stairs-popup-header .close-popup:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.stairs-popup-body {
    padding: 20px;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #171717;
}

.stairs-config-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
    flex: 1;
    min-height: 0;
}

.stairs-left-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
}

.stairs-dropdowns {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stairs-measurements {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.measurement-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 10px;
    align-items: center;
}

.measurement-row label {
    font-weight: 700;
    color: #171717 !important;
    text-align: right;
    padding-right: 10px;
    font-size: 16px;
    background: transparent;
    border: none;
    display: block;
    min-width: 100px;
}

.measurement-row input,
.measurement-row select {
    padding: 8px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    font-size: 14px;
    background: #ffffff;
    color: #171717;
}

.measurement-row select:focus,
.measurement-row input:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.stairs-middle-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
}

.stair-width-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stair-width-section label {
    font-weight: 700;
    color: #171717 !important;
    font-size: 16px;
    background: transparent;
    border: none;
    display: block;
    margin-bottom: 10px;
}

.width-inputs {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.feet-input,
.inches-input {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.feet-input input,
.inches-input input {
    width: 60px;
    padding: 8px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    text-align: center;
    background: #ffffff;
    color: #171717;
}

.feet-input input:focus,
.inches-input input:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.clear-btn {
    background: #ffffff;
    color: #171717;
    border: 1px solid #e5e5e5;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-btn:hover {
    background: #f2f2f2;
    border-color: #d4d4d4;
}

.number-pads {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.feet-pad,
.inches-pad {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.feet-pad h4,
.inches-pad h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #171717;
    text-align: center;
}

.number-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}

.number-btn {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #171717;
    transition: all 0.2s;
}

.number-btn:hover {
    background: #f2f2f2;
    border-color: #d4d4d4;
}

.number-btn:active {
    background: #e5e5e5;
    color: #171717;
}

.stairs-right-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    justify-content: flex-start;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
}

.apply-btn {
    background: #ffffff;
    color: #16a34a;
    border: 1px solid #16a34a;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.apply-btn:hover {
    background: #16a34a;
    color: #ffffff;
}

.steps-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.steps-section label {
    font-weight: 700;
    color: #171717 !important;
    font-size: 16px;
    background: transparent;
    border: none;
    display: block;
    margin-bottom: 10px;
}

.steps-section input {
    padding: 8px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    font-size: 14px;
    width: 100px;
    background: #ffffff;
    color: #171717;
}

.example-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.example-annotation {
    display: flex;
    align-items: center;
    gap: 10px;
}

.red-text {
    color: #dc3545;
    font-weight: 500;
    font-size: 14px;
}

.arrow {
    color: #dc3545;
    font-size: 16px;
    font-weight: bold;
}

.handwritten-example {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    min-height: 200px;
    max-height: 250px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    color: #171717;
    white-space: pre-wrap;
    overflow-y: scroll;
    word-wrap: break-word;
    display: block;
}

.stairs-popup-footer {
    background: #171717;
    padding: 15px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    position: relative;
    z-index: 9999;
    border-top: 1px solid #333;
}

/* Force label visibility */
.stairs-config-layout label {
    color: #171717 !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    background: transparent !important;
}

/* Steps section styling */
.steps-section {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 10px;
    align-items: center;
    margin-top: 0px;
}

.steps-section label {
    font-weight: 700;
    color: #171717 !important;
    text-align: right;
    padding-right: 10px;
    font-size: 16px;
    background: transparent;
    border: none;
    display: block;
    min-width: 100px;
}

.steps-section input {
    padding: 8px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    font-size: 14px;
    background: #ffffff;
    color: #171717;
    text-align: center;
}

.steps-section input:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

/* Cut Sizes Section (Carpet Stairs Only) */
.cut-sizes-section {
    margin-top: 10px;
    padding: 15px;
    background: #f2f2f2;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
}

.cut-sizes-title {
    text-align: center;
    margin-bottom: 15px;
}

.cut-sizes-title h4 {
    margin: 0;
    color: #000000;
    font-size: 16px;
    font-weight: 600;
}

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

.carpet-size-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 10px;
    align-items: center;
}

.carpet-size-row label {
    font-weight: 700;
    color: #171717 !important;
    text-align: right;
    padding-right: 10px;
    font-size: 16px;
    background: transparent;
    border: none;
    display: block;
    min-width: 100px;
}

.carpet-size-row select {
    padding: 8px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    font-size: 14px;
    background: #ffffff;
    color: #171717;
}

.carpet-size-row select:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.dimensions-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.dimension-input {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dimension-input input {
    padding: 8px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    font-size: 14px;
    background: #ffffff;
    color: #171717;
    text-align: center;
    width: 60px;
}

.dimension-input input:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.dimension-input .unit {
    font-size: 14px;
    color: #000000;
    font-weight: 500;
}

.multiply {
    font-size: 16px;
    color: #000000;
    font-weight: bold;
}

/* Buttons section inside right column */
.stairs-buttons-section {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Transitions Tab Layout */
.transitions-layout {
    display: flex;
    height: calc(100vh - 120px);
    gap: 20px;
}

.transitions-sidebar {
    width: 320px;
    background: #fafafa;
    border-radius: 8px;
    padding: 24px;
    border: 1px solid #e5e5e5;
    overflow-y: auto;
}

.transitions-sidebar h2 {
    margin: 0 0 24px 0;
    color: #171717;
    font-size: 20px;
    font-weight: 600;
}

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

.transitions-sidebar label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #171717;
}

.transitions-sidebar select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    background: #ffffff;
    color: #171717;
    font-size: 14px;
}

.transitions-sidebar select:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2);
}

.transitions-sidebar select:disabled {
    background: #fafafa;
    color: #737373;
    cursor: not-allowed;
    opacity: 0.6;
}

.transitions-sidebar .btn {
    width: 100%;
    margin-top: 20px;
}

/* Transitions List Styles */
.transitions-list {
    margin-top: 20px;
    border-top: 1px solid #e5e5e5;
    padding-top: 15px;
}

.transitions-list h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: white;
    font-weight: 600;
}

.transitions-list-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.transition-item {
    padding: 8px 12px;
    border-bottom: 1px solid #e5e5e5;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 12px;
    color: #171717;
}

/* Fix text colors for transition items inside white container */
.transitions-list-container .transition-item {
    color: #333;
    border-bottom-color: #ddd;
}

.transitions-list-container .transition-item .transition-number {
    color: #000000;
}

.transitions-list-container .transition-item .transition-room {
    color: #666;
}

.transitions-list-container .transition-item .transition-label {
    color: #000000;
}

.transitions-list-container .transition-item.unspecified .transition-label {
    color: #e67e22;
}

.transitions-list-container .transition-item:hover {
    background-color: #f0f0f0;
}

.transitions-list-container .transition-item.selected {
    background-color: #e8f4fd;
    border-left: 3px solid #000000;
}

/* Refresh button in transitions list - black text on light background */
.transitions-list #refreshTransitionsBtn,
.transitions-list .btn-sm {
    background: white;
    color: #333;
    border: 1px solid #ddd;
}

.transitions-list #refreshTransitionsBtn i,
.transitions-list .btn-sm i {
    color: #333;
}

.transition-item:last-child {
    border-bottom: none;
}

.transition-item:hover {
    background-color: #e5e5e5;
}

.transition-item.selected {
    background-color: #e5e5e5;
    border-left: 3px solid #000000;
}

.transition-item .transition-number {
    font-weight: bold;
    color: #000000;
    margin-right: 8px;
}

.transition-item .transition-type {
    font-weight: 500;
    margin-right: 8px;
}

.transition-item .transition-room {
    color: #737373;
    font-style: italic;
}

/* Doorway width shown on each transitions-list row (the LF the quote charges) */
.transition-item .transition-width {
    margin-left: auto;
    padding: 1px 6px;
    border-radius: 4px;
    background: #f2f2f2;
    color: #404040;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.transition-item .transition-label {
    color: #000000;
    font-weight: 500;
    margin-top: 2px;
    font-size: 11px;
}

.transition-item.unspecified .transition-label {
    color: #ffd93d;
}

/* Mated transition styles (connected rooms) */
.transition-item.mated-transition {
    background-color: rgba(0, 0, 0, 0.1);
    border-left: 3px solid #000000;
}

.transitions-list-container .transition-item.mated-transition {
    background-color: rgba(0, 0, 0, 0.1);
    border-left: 3px solid #000000;
}

.mated-indicator {
    color: #000000;
    font-weight: bold;
    font-size: 14px;
    margin-right: 4px;
}

.transitions-list-container .mated-indicator {
    color: #000000;
}

.transitions-canvas-container {
    flex: 1;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.transitions-canvas-wrapper {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    position: relative;
}

#transitionsCanvas {
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fafafa;
    pointer-events: none; /* Will be set to 'auto' by JS when tab is active */
    position: absolute;
    inset: 0;
    z-index: 0;
    /* Default to hidden - JS will show when transitions tab is active */
    display: none;
    visibility: hidden;
    opacity: 0;
}

#konvaContainer {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
}

.transitions-zoom-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    background: #fafafa;
    border-radius: 6px;
}

.transitions-zoom-controls .zoom-btn {
    background: #000000;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease;
    min-width: 60px;
    width: auto;
    height: auto;
}

.transitions-zoom-controls .zoom-btn:hover {
    background: #5a6fd8;
}

.transitions-zoom-controls .zoom-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.zoom-level {
    font-size: 14px;
    color: #666;
    min-width: 60px;
    text-align: center;
}

.project-info h3 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 18px;
}

.project-info p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.project-info {
    flex: 1;
    min-width: 0;
}

.project-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.project-actions button {
    padding: 8px 12px;
    font-size: 12px;
}

.pdf-info {
    text-align: center;
    color: #333;
}

.pdf-info h3 {
    margin: 0 0 15px 0;
    color: #000000;
    font-size: 20px;
}

.pdf-info p {
    margin: 10px 0;
    color: #666;
    font-size: 14px;
}

.pdf-info button {
    margin-top: 20px;
}

/* Tab Navigation - Folder Style */
.tab-navigation {
    display: flex;
    background: #fafafa;
    border-bottom: 1px solid #e5e5e5;
    overflow-x: auto;
    flex-shrink: 0;
    padding: 0 20px;
    position: relative;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

/* Hide scrollbar for Chrome/Safari */
.tab-navigation::-webkit-scrollbar {
    display: none;
}

/* Hide tab navigation when home page is active */
.home-page.active~.tab-navigation,
.home-page.active+.tab-navigation {
    display: none;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px 16px 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #737373;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    position: relative;
    margin-right: 2px;
    border-radius: 0;
    box-shadow: none;
    z-index: 1;
    transform: none;
    /* Responsive - allow shrinking */
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
}

.tab-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tab-btn:hover {
    background: transparent;
    color: #171717;
    z-index: 2;
}

.tab-btn.active {
    background: transparent;
    border: none;
    border-bottom: 2px solid #000000;
    color: #000000;
    transform: none;
    box-shadow: none;
    z-index: 3;
}

.tab-btn.active::after {
    display: none;
}

.tab-btn i {
    font-size: 16px;
    color: #737373;
}

.tab-btn.active i {
    color: #000000;
}

/* Tab Content */
.tab-content {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #ffffff;
}

/* Hide tab content when home page is active */
.home-page.active~.tab-content,
.home-page.active+.tab-content {
    display: none;
}

.tab-panel {
    display: none;
    height: 100%;
    overflow: hidden;
    background: #ffffff;
}

.tab-panel.active {
    display: block;
    background: #ffffff;
}

/* Draw Layout */
.draw-layout {
    display: flex;
    height: 100%;
    overflow: hidden;
    background: #ffffff;
}

/* Tab Panel Content Styles */
.project-info-content,
.room-details-content,
.transitions-content,
.existing-surfaces-content,
.notes-content,
.charges-content,
.estimate-summary-content {
    padding: 16px;
    max-width: 1200px;
    margin: 0 auto;
    background: #ffffff;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

/* Notes & Charges tabs: flex column to fill tab panel height */
.notes-content,
.charges-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
}

/* Customer Info Display */
.customer-info-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 40px 20px;
    background: #ffffff;
}

.customer-info-box {
    background: #fafafa;
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    text-align: center;
}

.customer-name {
    font-size: 24px;
    font-weight: bold;
    color: #171717;
    margin-bottom: 15px;
}

.customer-address,
.customer-phone,
.customer-email,
.customer-notes {
    font-size: 16px;
    color: #737373;
    margin-bottom: 10px;
    line-height: 1.4;
}

.customer-email,
.customer-notes {
    font-style: italic;
    color: #737373;
}

.customer-info-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-edit-info {
    background: #e5e5e5;
    color: #171717;
    border: 2px solid #e5e5e5;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-edit-info:hover {
    background: #f2f2f2;
    border-color: #000000;
    color: #000000;
}

.btn-save-info {
    background: #000000;
    color: #ffffff;
    border: 2px solid #000000;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-save-info:hover {
    background: #333333;
    border-color: #333333;
}

/* Customer Info Two-Column Layout */
.customer-form-layout {
    display: flex;
    gap: 40px;
    margin-top: 20px;
}

.customer-form-layout {
    display: flex;
    gap: 40px;
    margin-top: 20px;
}

.form-column {
    flex: 1;
    min-width: 0;
    /* Prevents flex items from overflowing */
}

.form-column .form-group {
    margin-bottom: 24px;
}

/* Room Details Specific Styles */
.room-form-layout {
    display: flex;
    gap: 40px;
    margin-top: 20px;
}

.flooring-selection {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flooring-selection .flooring-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #fafafa;
    border: 2px solid #e5e5e5;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #171717;
}

.flooring-selection .flooring-item:hover {
    border-color: #000000;
    background: #e5e5e5;
}

.flooring-selection .flooring-item.selected {
    border-color: #000000;
    background: #e5e5e5;
}

.flooring-selection .flooring-color {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 2px solid #e9ecef;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.flooring-selection .flooring-item.selected .flooring-color {
    border-color: #000000;
}

/* Material Dropdown Styles */
.material-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 5px;
    padding: 10px;
    background: #f8f9ff;
    border: 2px solid #000000;
    border-radius: 6px;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.flooring-item {
    position: relative;
}

.material-select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.material-select:focus {
    outline: none;
    border-color: #000000;
}

.material-select option {
    padding: 8px;
    color: #333;
}

.price-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-input .currency {
    font-weight: 600;
    color: #495057;
    font-size: 16px;
}

.price-input input {
    flex: 1;
}

.add-room-btn {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

.add-room-btn:hover {
    background: var(--success-hover);
}

.rooms-list {
    margin-top: 20px;
}

.rooms-list h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 20px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
}

.rooms-container {
    display: grid;
    gap: 16px;
}

.empty-rooms {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    background: var(--card-bg);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
}

.empty-rooms i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-rooms p {
    font-size: 14px;
}

/* Room Item Styles */
.room-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s ease;
}

.room-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.room-header h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.room-level {
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

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

.room-flooring {
    display: flex;
    align-items: center;
    gap: 8px;
}

.room-flooring .flooring-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.room-pricing {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    font-size: 14px;
    color: var(--text-light);
}

.room-notes {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-light);
    border-left: 3px solid var(--primary-color);
}

.room-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ========================================
   ROOMS & FLOORING TAB - NEW LAYOUT
   ======================================== */

/* Sub-tab Navigation */
.room-details-subtabs {
    display: flex;
    gap: 0;
    background: #171717;
    border-bottom: 2px solid #fafafa;
    padding: 0;
    margin-bottom: 0;
}

.subtab-btn {
    padding: 12px 24px;
    background: #171717;
    border: none;
    border-bottom: 3px solid transparent;
    color: #737373;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.subtab-btn:hover {
    background: #fafafa;
    color: #171717;
}

.subtab-btn.active {
    background: #EDEDED;
    color: #171717;
    border-bottom-color: #525252;
}

/* Sub-tab Content */
.subtab-content {
    background: #ffffff;
    min-height: 500px;
    flex: 1;
    overflow: hidden;
}

.subtab-panel {
    display: none;
    padding: 0;
    height: 100%;
}

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

/* Placeholder Content */
.placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #737373;
}

.placeholder-content i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.placeholder-content p {
    font-size: 18px;
}

/* ========================================
   Project Information / Site Info Section
   ======================================== */

.site-info-container {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.site-info-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px;
    background: #fafafa;
    border-radius: 6px;
    border: 1px solid #e5e5e5;
}

.site-info-row label {
    font-weight: 600;
    color: #171717;
    min-width: 140px;
}

.site-info-select {
    flex: 1;
    max-width: 200px;
    padding: 10px 15px;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    color: #171717;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.site-info-select:hover {
    border-color: #000000;
}

.site-info-select:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2);
}

/* Summary Table Section */
.site-summary-section {
    background: #fafafa;
    border-radius: 6px;
    border: 1px solid #e5e5e5;
    overflow: hidden;
}

.site-summary-table {
    width: 100%;
    border-collapse: collapse;
}

.site-summary-table thead {
    background: #fafafa;
}

.site-summary-table th {
    padding: 12px 15px;
    text-align: left;
    color: #000000;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 2px solid #e5e5e5;
}

.site-summary-table th.summary-question-col {
    width: auto;
}

.site-summary-table th.summary-checkbox-col {
    width: 80px;
    text-align: center;
}

.checkbox-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-header input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #000000;
}

.checkbox-header span {
    font-size: 13px;
}

.site-summary-table tbody tr {
    border-bottom: 1px solid #e5e5e5;
    transition: background 0.15s ease;
}

.site-summary-table tbody tr:hover {
    background: #f2f2f2;
}

.site-summary-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.site-summary-table tbody tr:nth-child(even):hover {
    background: #f2f2f2;
}

.site-summary-table td {
    padding: 12px 15px;
    color: #737373;
    font-size: 14px;
}

.site-summary-table td:first-child {
    color: #171717;
}

.site-summary-table td:not(:first-child) {
    text-align: center;
}

.site-summary-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #000000;
    transition: transform 0.1s ease;
}

.site-summary-table input[type="checkbox"]:hover {
    transform: scale(1.1);
}

.site-summary-table input[type="checkbox"]:checked {
    accent-color: #000000;
}

/* Scrollable table body for many rows */
.site-summary-section {
    max-height: calc(100vh - 350px);
    overflow-y: auto;
}

/* Custom scrollbar for site summary */
.site-summary-section::-webkit-scrollbar {
    width: 8px;
}

.site-summary-section::-webkit-scrollbar-track {
    background: #ffffff;
}

.site-summary-section::-webkit-scrollbar-thumb {
    background: #e5e5e5;
    border-radius: 4px;
}

.site-summary-section::-webkit-scrollbar-thumb:hover {
    background: #000000;
}

/* ========================================
   End Project Information / Site Info
   ======================================== */

/* ========================================
   Site Charges Sub-tab
   ======================================== */

.site-charges-container {
    padding: 20px;
    max-width: 700px;
    margin: 0 auto;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
}

/* Scrollbar styling for site charges */
.site-charges-container::-webkit-scrollbar {
    width: 8px;
}

.site-charges-container::-webkit-scrollbar-track {
    background: #ffffff;
    border-radius: 4px;
}

.site-charges-container::-webkit-scrollbar-thumb {
    background: #e5e5e5;
    border-radius: 4px;
}

.site-charges-container::-webkit-scrollbar-thumb:hover {
    background: #000000;
}

/* Make the site charges panel scrollable */
#site-charges-panel {
    overflow-y: auto;
    max-height: calc(100vh - 250px);
}

.site-charges-table {
    width: 100%;
    border-collapse: collapse;
    background: #fafafa;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e5e5e5;
}

.site-charges-table thead {
    background: #fafafa;
}

.site-charges-table th {
    padding: 12px 15px;
    text-align: left;
    color: #000000;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 2px solid #e5e5e5;
}

.site-charges-table th.site-charge-name-col {
    width: auto;
}

.site-charges-table th.site-charge-qty-col {
    width: 60px;
    text-align: center;
}

.site-charges-table th.site-charge-action-col {
    width: 80px;
    text-align: center;
}

.site-charges-table tbody tr {
    border-bottom: 1px solid #e5e5e5;
    transition: background 0.15s ease;
}

.site-charges-table tbody tr:hover {
    background: #f2f2f2;
}

.site-charges-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.site-charges-table tbody tr:nth-child(even):hover {
    background: #f2f2f2;
}

.site-charges-table td {
    padding: 12px 15px;
    color: #171717;
    font-size: 14px;
}

.site-charges-table td.site-charge-qty {
    text-align: center;
    font-weight: 600;
    color: #000000;
}

.site-charge-add-btn {
    padding: 6px 14px;
    background: #000000;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.site-charge-add-btn:hover {
    background: #333333;
    transform: translateY(-1px);
}

.site-charge-add-btn:active {
    transform: translateY(0);
}

/* Site Charge Modal Overlay */
.site-charge-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

/* Site Charge Modal */
.site-charge-modal {
    background: #fafafa;
    border-radius: 8px;
    width: 350px;
    max-width: 90%;
    border: 1px solid #e5e5e5;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.2s ease;
}

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

.site-charge-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e5e5e5;
    background: #fafafa;
    border-radius: 8px 8px 0 0;
}

.site-charge-modal-header h3 {
    margin: 0;
    color: #000000;
    font-size: 16px;
    font-weight: 600;
}

.site-charge-modal-body {
    padding: 20px;
}

.site-charge-item-name {
    color: #171717;
    font-size: 14px;
    margin: 0 0 20px 0;
    padding: 10px;
    background: #fafafa;
    border-radius: 4px;
    text-align: center;
}

.site-charge-quantity-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.site-charge-quantity-row label {
    color: #737373;
    font-size: 14px;
    font-weight: 500;
}

.site-charge-spinner {
    display: flex;
    align-items: center;
    gap: 0;
}

.spinner-btn {
    width: 36px;
    height: 36px;
    background: #e5e5e5;
    color: #000000;
    border: 1px solid #e5e5e5;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-btn.spinner-down {
    border-radius: 4px 0 0 4px;
}

.spinner-btn.spinner-up {
    border-radius: 0 4px 4px 0;
}

.spinner-btn:hover {
    background: #000000;
    color: #ffffff;
}

.site-charge-quantity-input {
    width: 60px;
    height: 36px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #171717;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-left: none;
    border-right: none;
    -moz-appearance: textfield;
}

.site-charge-quantity-input::-webkit-outer-spin-button,
.site-charge-quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.site-charge-quantity-input:focus {
    outline: none;
    background: #fafafa;
}

.site-charge-modal-footer {
    padding: 15px 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 1px solid #e5e5e5;
    background: #fafafa;
    border-radius: 0 0 8px 8px;
}

.site-charge-cancel-btn {
    padding: 10px 20px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.site-charge-cancel-btn:hover {
    background: #ff4d5e;
}

.site-charge-confirm-btn {
    padding: 10px 20px;
    background: #000000;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.site-charge-confirm-btn:hover {
    background: #333333;
}

/* ========================================
   End Site Charges Sub-tab
   ======================================== */

/* Rooms & Flooring 5-Column Layout */
.rooms-flooring-layout {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(160px, 200px) 56px minmax(180px, 240px) minmax(280px, 1fr);
    gap: 0;
    height: calc(100vh - 220px);
    min-height: 400px;
    background: #ffffff;
    overflow: hidden;
}

/* Column Base Styles */
.rf-column {
    display: flex;
    flex-direction: column;
    background: #fafafa;
    border-right: 1px solid #f2f2f2;
    overflow: hidden;
    min-height: 0;
}

.rf-column:last-child {
    border-right: none;
}

.rf-column.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.rf-column.disabled .rf-column-list {
    background: #fafafa;
}

/* Column Header */
.rf-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f2f2f2;
    border-bottom: 2px solid #e5e5e5;
    min-height: 48px;
    flex-shrink: 0;
}

.rf-column-header span {
    font-size: 14px;
    font-weight: 700;
    color: #171717;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rf-add-btn {
    width: 28px;
    height: 28px;
    background: #000000;
    border: none;
    border-radius: 4px;
    color: #ffffff;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rf-add-btn:hover {
    background: #333333;
    transform: scale(1.1);
}

/* Column List */
.rf-column-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
    min-height: 0;
}

/* Custom Scrollbar */
.rf-column-list::-webkit-scrollbar {
    width: 8px;
}

.rf-column-list::-webkit-scrollbar-track {
    background: #ffffff;
}

.rf-column-list::-webkit-scrollbar-thumb {
    background: #e5e5e5;
    border-radius: 4px;
}

.rf-column-list::-webkit-scrollbar-thumb:hover {
    background: #000000;
}

/* List Item Base Styles */
.rf-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    margin-bottom: 4px;
    background: #ffffff;
    border: 2px solid #e5e5e5;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #737373;
    font-size: 12px;
    line-height: 1.3;
}

.rf-list-item span {
    flex: 1;
    word-break: break-word;
}

.rf-list-item:hover {
    border-color: #000000;
    background: #fafafa;
    color: #171717;
}

.rf-list-item.selected {
    border-color: #171717;
    background: #EDEDED;
    color: #171717;
}

.rf-list-item.used {
    color: #000000;
    font-weight: 600;
}

/* Checkbox Visual */
.rf-list-item .rf-checkbox {
    width: 16px;
    height: 16px;
    min-width: 16px;
    border: 2px solid #e5e5e5;
    border-radius: 3px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rf-list-item.selected .rf-checkbox {
    background: #171717;
    border-color: #171717;
}

.rf-list-item.selected .rf-checkbox::after {
    content: '✓';
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
}

/* Category Header in Products List */
.rf-category-header {
    padding: 8px 12px;
    margin: 12px 0 4px 0;
    background: #f2f2f2;
    color: #000000;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
}

.rf-category-header:first-child {
    margin-top: 0;
}

/* Collapsible surface-type sections in the products list */
.rf-category-header.rf-collapsible {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    margin: 6px 0 0 0;
}

.rf-category-header.rf-collapsible:hover {
    background: #e8e8e8;
}

.rf-category-header.rf-collapsible.expanded {
    background: #171717;
    color: #ffffff;
    margin-bottom: 4px;
}

.rf-category-header.rf-collapsible i {
    font-size: 10px;
}

/* Letter Filter Column */
.rf-letter-column {
    width: 56px;
    min-width: 56px;
    max-width: 56px;
    overflow: hidden;
}

.rf-letter-column .rf-column-header {
    justify-content: center;
    padding: 12px 4px;
}

.rf-letter-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    padding: 3px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    align-content: start;
}

.rf-letter-btn {
    padding: 3px 1px;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 2px;
    color: #737373;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    min-height: 20px;
    min-width: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rf-letter-btn:hover {
    border-color: #000000;
    color: #000000;
}

.rf-letter-btn.active {
    background: #EDEDED;
    border-color: #171717;
    color: #171717;
}

/* Make "All" button span both columns */
.rf-letter-btn[data-letter="All"] {
    grid-column: span 2;
}

/* Summary Column */
.rf-summary-column {
    background: #fafafa;
    overflow: hidden;
}

.rf-summary-column .rf-column-header {
    background: #f2f2f2;
}

.rf-summary-column .rf-column-list {
    overflow-y: auto;
    min-height: 0;
}

.rf-delete-selected-btn {
    background: #e74c3c;
    border: none;
    border-radius: 4px;
    color: white;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
}

.rf-delete-selected-btn:hover {
    background: #c0392b;
}

/* Summary Item */
.rf-summary-item {
    display: flex;
    flex-direction: column;
    padding: 10px;
    margin-bottom: 6px;
    background: #fafafa;
    border: 2px solid #e5e5e5;
    border-radius: 6px;
    color: #171717;
    font-size: 12px;
}

.rf-summary-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.rf-summary-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #000000;
}

.rf-summary-item-name {
    flex: 1;
    font-weight: 600;
    font-size: 13px;
    color: #171717;
}

.rf-summary-item-details {
    font-size: 11px;
    color: #737373;
    padding-left: 26px;
    margin-bottom: 6px;
}

.rf-summary-item-details span {
    display: block;
    margin-bottom: 2px;
}

.rf-summary-item-actions {
    display: flex;
    gap: 6px;
    padding-left: 26px;
}

.rf-summary-btn {
    padding: 4px 12px;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rf-summary-btn.edit {
    background: #3498db;
    color: white;
}

.rf-summary-btn.edit:hover {
    background: #2980b9;
}

.rf-summary-btn.delete {
    background: #e74c3c;
    color: white;
}

.rf-summary-btn.delete:hover {
    background: #c0392b;
}

/* Modal Styles */
.rf-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 25, 47, 0.9);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.rf-modal.active {
    display: flex;
}

.rf-modal-content {
    background: #fafafa;
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.rf-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e5e5;
}

.rf-modal-header h3 {
    margin: 0;
    color: #171717;
    font-size: 18px;
}

.rf-modal-close {
    background: none;
    border: none;
    color: #737373;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.rf-modal-close:hover {
    color: #e74c3c;
}

.rf-modal-body {
    padding: 20px;
}

.rf-modal-body label {
    display: block;
    color: #737373;
    font-size: 13px;
    margin-bottom: 6px;
    font-weight: 600;
}

.rf-modal-body input,
.rf-modal-body select {
    width: 100%;
    padding: 12px;
    margin-bottom: 16px;
    background: #ffffff;
    border: 2px solid #e5e5e5;
    border-radius: 6px;
    color: #171717;
    font-size: 14px;
    box-sizing: border-box;
}

.rf-modal-body input:focus,
.rf-modal-body select:focus {
    outline: none;
    border-color: #000000;
}

.rf-modal-body select option {
    background: #ffffff;
    color: #171717;
}

.rf-stairs-toggle {
    margin-top: 8px;
    padding: 12px;
    background: #ffffff;
    border-radius: 6px;
}

.rf-stairs-toggle label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 0;
}

.rf-stairs-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #000000;
}

.rf-stairs-toggle span {
    color: #171717;
    font-size: 14px;
}

.rf-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #e5e5e5;
}

.rf-modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rf-modal-btn.cancel {
    background: #e5e5e5;
    color: #737373;
}

.rf-modal-btn.cancel:hover {
    background: #f2f2f2;
    color: #171717;
}

.rf-modal-btn.confirm {
    background: #000000;
    color: #ffffff;
}

.rf-modal-btn.confirm:hover {
    background: #333333;
}

/* Transform Tools Popup Styles */
.transform-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 25, 47, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.transform-popup {
    background: #fafafa;
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    width: 320px;
    max-width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.transform-popup-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e5e5;
}

.transform-popup-header h3 {
    margin: 0;
    color: #000000;
    font-size: 18px;
    text-align: center;
}

.transform-popup-body {
    padding: 20px;
    text-align: center;
}

.transform-popup-body p {
    color: #737373;
    margin-bottom: 16px;
    font-size: 14px;
}

.rotate-degree-options {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.rotate-degree-btn {
    padding: 16px 24px;
    background: #e5e5e5;
    border: 2px solid #3a5a8a;
    border-radius: 8px;
    color: #171717;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 70px;
}

.rotate-degree-btn:hover {
    background: #3a5a8a;
    border-color: #000000;
    color: #000000;
}

.rotate-degree-btn:active {
    background: #000000;
    color: #ffffff;
}

.transform-popup-footer {
    padding: 12px 20px;
    border-top: 1px solid #e5e5e5;
    display: flex;
    justify-content: center;
}

.transform-popup-cancel {
    padding: 10px 24px;
    background: #e5e5e5;
    border: none;
    border-radius: 6px;
    color: #737373;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.transform-popup-cancel:hover {
    background: #f2f2f2;
    color: #171717;
}

/* Empty State */
.rf-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #737373;
    text-align: center;
}

.rf-empty-state i {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.rf-empty-state p {
    font-size: 13px;
}

.project-info-content h2,
.transitions-content h2,
.existing-surfaces-content h2,
.notes-content h2,
.charges-content h2,
.estimate-summary-content h2 {
    color: white;
    margin-bottom: 24px;
    font-size: 24px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #171717 !important;
}

/* Ensure all form labels are light */
label {
    color: #171717 !important;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    background: #ffffff;
    color: #171717;
    font-size: 14px;
    transition: border-color 0.2s ease;
    pointer-events: auto !important;
    z-index: 1000 !important;
    position: relative !important;
    cursor: text !important;
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

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

/* Transition Types */
.transition-types,
.surface-types {
    display: grid;
    gap: 24px;
}

.transition-item,
.surface-item {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.transition-item h3,
.surface-item h3 {
    color: var(--primary-color);
    margin-bottom: 16px;
    font-size: 18px;
}

/* Charges */
.charge-items {
    display: grid;
    gap: 24px;
}

.charge-item {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.add-charge-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

/* Estimate Summary */
.summary-breakdown {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item.total {
    font-weight: 700;
    font-size: 18px;
    color: var(--primary-color);
    border-top: 2px solid var(--primary-color);
    padding-top: 16px;
    margin-top: 8px;
}

.generate-estimate-btn {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 auto;
}

.generate-estimate-btn:hover {
    background: var(--success-hover);
}

/* Sidebars */
.sidebar {
    width: 280px;
    background: #fafafa;
    border-right: 1px solid #e5e5e5;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.right-sidebar {
    border-right: none;
    border-left: 1px solid #e5e5e5;
    order: 3;
    /* Ensure it appears after the canvas */
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #fafafa;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #d4d4d4;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #a3a3a3;
}

/* Tool Sections */
.tool-section {
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.tool-section:last-child {
    border-bottom: none;
}

.tool-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #171717;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Room Selection Window */
.room-selection-window {
    min-height: 120px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    background: #ffffff;
    margin-bottom: 12px;
}

.no-rooms-message {
    text-align: center;
    padding: 20px;
    color: #737373;
}

.no-rooms-message i {
    font-size: 24px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.no-rooms-message p {
    font-size: 12px;
    margin: 0;
}

.room-selection-item {
    padding: 10px 12px;
    border: 2px solid transparent;
    border-bottom: 1px solid #e5e5e5;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fafafa;
    color: #171717;
    border-radius: 6px;
    margin: 2px 0;
}

.room-selection-item:last-child {
    border-bottom: none;
}

.room-selection-item:hover {
    background: #e5e5e5;
    border-color: #000000;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.room-selection-item.selected {
    background: #000000 !important;
    color: white !important;
    border: 3px solid #000000 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
    transform: translateY(-1px);
    animation: selectedPulse 2s ease-in-out infinite;
    position: relative;
}

.room-selection-item.selected::before {
    content: "✓ SELECTED";
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ff0000;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    z-index: 1000;
}

@keyframes selectedPulse {

    0%,
    100% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    }

    50% {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    }
}

.room-selection-item .room-info {
    flex: 1;
    min-width: 0;
}

.room-selection-item .room-name {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
    color: #333;
    opacity: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.room-selection-item.selected .room-name {
    color: white !important;
}

.room-selection-item .active-badge {
    background: #333333;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.room-selection-item .room-details {
    font-size: 11px;
    opacity: 1;
}

.room-selection-item.selected .room-details {
    color: rgba(255, 255, 255, 0.9) !important;
}

.room-selection-item .room-status {
    font-size: 10px;
    font-weight: 600;
    margin-top: 2px;
}

.room-selection-item .room-status.complete {
    color: #43e97b;
}

.room-selection-item .room-status.incomplete {
    color: #fa709a;
}

.room-selection-item .room-status.not-started {
    color: #9E9E9E;
}

.room-selection-item.selected .room-status {
    color: rgba(255, 255, 255, 0.9) !important;
}

.room-selection-item .flooring-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.room-selection-item.selected .flooring-color {
    border-color: white !important;
}

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

/* Tool Buttons */
.tool-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tool-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fafafa;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    color: #171717;
}

.tool-btn:hover {
    border-color: #000000;
    background: #e5e5e5;
}

.tool-btn.active {
    border-color: #000000;
    background: #000000;
    color: #ffffff;
}

.tool-btn i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: inherit;
}

/* Door and Opening button colors */
.tool-btn[data-tool="door"] {
    color: #171717;
}

.tool-btn[data-tool="opening"] {
    color: #171717;
}

/* Transform tool button colors */
.tool-btn[data-tool="mirror"] {
    color: #171717;
}

.tool-btn[data-tool="rotate"] {
    color: #171717;
}

.tool-btn[data-tool="move"] {
    color: #171717;
}



/* Hover effects for transform tools */
.tool-btn[data-tool="mirror"]:hover:not(:disabled) {
    background: rgba(156, 39, 176, 0.2);
    border-color: #9c27b0;
}

.tool-btn[data-tool="rotate"]:hover:not(:disabled) {
    background: rgba(255, 152, 0, 0.2);
    border-color: #ff9800;
}

.tool-btn[data-tool="move"]:hover:not(:disabled) {
    background: rgba(96, 125, 139, 0.2);
    border-color: #607d8b;
}



/* Active states for transform tools */
.tool-btn[data-tool="mirror"].active {
    background: #9c27b0;
    color: white;
}

.tool-btn[data-tool="rotate"].active {
    background: #ff9800;
    color: white;
}

.tool-btn[data-tool="move"].active {
    background: #607d8b;
    color: white;
}



/* Disabled states for transform tools */
.tool-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #fafafa;
    color: #737373;
}

.tool-btn:disabled:hover {
    background: #fafafa !important;
    color: #737373 !important;
    border-color: #e5e5e5 !important;
}

/* Door and Opening hover and active states */
.tool-btn[data-tool="door"]:hover {
    background: rgba(0, 102, 204, 0.2);
    border-color: #000000;
}

.tool-btn[data-tool="door"].active {
    background: #000000;
    color: white;
    border-color: #000000;
}

.tool-btn[data-tool="opening"]:hover {
    background: rgba(255, 204, 0, 0.2);
    border-color: #ffcc00;
}

.tool-btn[data-tool="opening"].active {
    background: #ffcc00;
    color: white;
}

/* Flooring Types */
.flooring-types {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flooring-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #000000;
}

.flooring-item span {
    color: #000000 !important;
}

.flooring-item:hover {
    border-color: #000000;
    background: #f8f9ff;
}

.flooring-item.selected {
    border-color: #000000;
    background: #f0f4ff;
}

.flooring-color {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 2px solid #e9ecef;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.flooring-item.selected .flooring-color {
    border-color: #000000;
}

/* Calculations */
.calc-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.calc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.calc-item:last-child {
    border-bottom: none;
}

.calc-item.total {
    font-weight: 600;
    font-size: 16px;
    color: #000000;
    border-top: 2px solid #000000;
    padding-top: 12px;
    margin-top: 8px;
}

.calc-item input {
    width: 60px;
    padding: 4px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    text-align: center;
}

/* Canvas Section */
.canvas-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fafafa;
}

.canvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #e5e5e5;
    background: #f8f9fa;
}

.canvas-controls {
    display: flex;
    gap: 8px;
}

.canvas-info {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #6c757d;
}

.canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

#konvaCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: auto;
}

/* Ensure Konva canvas is above Fabric and interactive */
#konvaCanvas canvas {
    position: absolute;
    z-index: 3;
    pointer-events: auto;
}

#flooringCanvas {
    position: absolute;
    z-index: -1;
    pointer-events: none !important;
    display: none !important;
    visibility: hidden !important;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: none;
    /* hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 9999;
    /* on top of everything */
    pointer-events: none;
    /* IMPORTANT: never block clicks when hidden */
}

.loading-overlay.visible {
    display: flex;
    pointer-events: auto;
    /* block clicks ONLY while visible */
}

.loading-card {
    min-width: 260px;
    padding: 16px 20px;
    background: #121212;
    color: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    display: grid;
    grid-row-gap: 10px;
    place-items: center;
    text-align: center;
}

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #fff3;
    border-top-color: #09f;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Base hook added in JS */
.konva-container {
    cursor: default;
}

/* Pan mode */
.konva-container.pan {
    cursor: grab !important;
}

.konva-container.pan.dragging {
    cursor: grabbing !important;
}

/* Draw modes: wall/door/opening */
.konva-container.draw {
    cursor: crosshair !important;
}

/* Transitions canvas - pointer events controlled by JS showTransitionsCanvas() */
#transitionsCanvas {
    /* pointer-events controlled by JavaScript when tab is shown/hidden */
}

/* Make cursor changes immediate and consistent */
/* Allow JS to control cursor; keep neutral here */
.konvajs-content {
    cursor: default;
}

/* Legacy helper classes (deprecated - use .konva-container.* classes) */
.cursor-grab {
    cursor: grab !important;
}

.cursor-grabbing {
    cursor: grabbing !important;
}

.cursor-crosshair {
    cursor: crosshair !important;
}

/* Wall Sizing Interface Styles */
.wall-sizing-content {
    padding: 15px;
}

.wall-info {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
}

.wall-info h4 {
    margin: 0 0 8px 0;
    color: #495057;
    font-size: 14px;
}

.wall-info p {
    margin: 4px 0;
    font-size: 12px;
    color: #6c757d;
}

.pin-pad-container h4 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 14px;
}

.pin-pad {
    display: grid;
    grid-template-rows: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 15px;
}

.pin-pad-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.pin-btn {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px 8px;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 40px;
}

.pin-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.pin-btn:active {
    background: #dee2e6;
    transform: scale(0.95);
}

.length-input {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.length-input input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    background: #f8f9fa;
}

.length-input select {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    min-width: 80px;
}

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

.wall-actions .btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 12px;
}

#flooringCanvas {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    touch-action: none;
    /* IMPORTANT: Hide flooringCanvas - Konva handles all drawing */
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    /* Keep Fabric non-interactive when Konva is active */
}

.canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10;
}

/* Properties Panel */
.properties-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.property-group label {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.property-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.property-row input,
.property-row select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    flex: 1;
}

.property-row input:focus,
.property-row select:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.property-row textarea {
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.property-row textarea:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

/* Project Items */
.project-items {
    min-height: 200px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
}

/* Project Item Styles */
.project-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.project-item:hover {
    border-color: #000000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.item-type {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.item-flooring {
    background: #000000;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.item-details {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #6c757d;
}

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

.btn-edit,
.btn-delete {
    background: none;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    min-height: 32px;
    min-width: 32px;
}

.btn-edit {
    color: #000000;
    border-color: #28a745;
}

.btn-edit:hover {
    background: #28a745;
    color: white;
}

.btn-delete {
    color: #000000 !important;
    border-color: #dc3545;
}

.btn-delete:hover {
    background: #dc3545;
    color: white;
}

/* Status Bar - Hidden per user request */
.status-bar {
    display: none;
}

.status-right {
    display: flex;
    gap: 20px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fafafa;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
    border: 2px solid #e5e5e5;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #171717;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #737373;
    color: #6c757d;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f8f9fa;
    color: #495057;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #e5e5e5;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #171717;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    background: #ffffff;
    color: #171717;
}

.form-group input:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

/* Touch-specific optimizations */
@media (pointer: coarse) {
    .tool-btn {
        padding: 16px 20px;
        font-size: 16px;
    }

    .flooring-item {
        padding: 14px 16px;
    }

    .btn {
        padding: 14px 20px;
        font-size: 16px;
    }

    .sidebar {
        width: 320px;
    }

    .tool-section {
        padding: 24px;
    }

    .project-item {
        padding: 20px;
    }

    .btn-edit,
    .btn-delete {
        padding: 10px 14px;
        font-size: 14px;
        min-height: 40px;
        min-width: 40px;
    }
}

/* Wall Length Dialog */
.wall-length-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.wall-length-dialog .dialog-content {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    min-width: 300px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.wall-length-dialog h3 {
    margin: 0 0 20px 0;
    color: var(--text-color);
    text-align: center;
}

.length-inputs {
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.input-group label {
    flex: 0 0 60px;
    color: var(--text-color);
    font-weight: 500;
}

.length-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 14px;
}

.length-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2);
}

.dialog-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.dialog-buttons .btn {
    min-width: 80px;
}

/* Room Measurement Popup */
.room-measurement-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 1000px;
    height: 80%;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
}

.popup-header h3 {
    margin: 0;
    color: #333;
}

.close-popup {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.popup-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.measurement-left {
    width: 300px;
    padding: 20px;
    border-right: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.measurement-right {
    flex: 1;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.current-wall-info h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
}

.room-area-display {
    padding: 10px;
    background: #e8f4fd;
    border: 1px solid #000000;
    border-radius: 4px;
    font-weight: bold;
    color: #000000;
}

.length-inputs {
    display: flex;
    gap: 10px;
}

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

.length-input {
    width: 70px;
    padding: 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
}

.unit-label {
    font-size: 12px;
    font-weight: bold;
    color: #666;
}

.keypad-section {
    margin-bottom: 15px;
}

.keypad-section h5 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #333;
}

.feet-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}

.inches-keypad {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
}

.keypad-btn {
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s;
}

.keypad-btn:hover {
    background: #e9ecef;
    border-color: #000000;
}

.keypad-btn:active {
    background: #000000;
    color: white;
}

.measurement-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
}

.measurement-buttons .btn {
    padding: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.2s;
}

.measurement-buttons .btn-primary {
    background: #000000;
    color: #ffffff;
}

.measurement-buttons .btn-primary:hover {
    background: #333333;
}

.measurement-buttons .btn-success {
    background: #000000;
    color: #ffffff;
}

.measurement-buttons .btn-success:hover {
    background: #333333;
}

#roomMeasurementCanvas {
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background: white;
    cursor: crosshair;
}

/* Wall Length Keypad */
.wall-length-keypad {
    margin-top: 0;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    height: calc(100vh - 120px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.wall-length-keypad h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 14px;
    text-align: center;
}

.length-inputs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    justify-content: center;
}

.input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.input-group .length-input,
.input-group .unit-label {
    margin: 0;
}

.length-input {
    width: 70px;
    padding: 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
}

.unit-label {
    font-size: 12px;
    font-weight: bold;
    color: #666;
}

.keypad-section {
    margin-bottom: 8px;
}

.keypad-section h5 {
    margin: 0 0 4px 0;
    font-size: 22px;
    color: #333;
    text-align: center;
}

.feet-keypad {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    max-width: 200px;
    margin: 0 auto;
}

/* Special positioning for feet keypad - 9 under 6, 0 under 7, Clear under 8 */
.feet-keypad .keypad-btn:nth-child(9) {
    grid-column: 2;
}

.feet-keypad .keypad-btn:nth-child(10) {
    grid-column: 3;
}

.clear-btn {
    background: #dc3545 !important;
    color: white !important;
    font-size: 9px !important;
    padding: 4px 8px !important;
    min-height: 20px !important;
    margin-top: 3px;
}

.clear-btn:hover {
    background: #c82333 !important;
}

.inches-keypad {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    max-width: 200px;
    margin: 0 auto;
}

.keypad-btn {
    padding: 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.2s;
    min-height: 30px;
}

.keypad-btn:hover {
    background: #e9ecef;
    border-color: #000000;
}

.keypad-btn:active {
    background: #000000;
    color: white;
}

.wall-keypad-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.wall-keypad-buttons .btn {
    padding: 6px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
    transition: background-color 0.2s;
}

.wall-keypad-buttons .btn-primary {
    background: #000000;
    color: #ffffff;
}

.wall-keypad-buttons .btn-primary:hover {
    background: #333333;
}

.wall-keypad-buttons .btn-secondary {
    background: #e5e5e5;
    color: #171717;
}

.wall-keypad-buttons .btn-secondary:hover {
    background: #f2f2f2;
}

/* Wall Length Dialog */
.wall-length-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.dialog-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    min-width: 350px;
}

.dialog-content h3 {
    margin: 0 0 20px 0;
    color: #333;
    text-align: center;
    font-size: 20px;
}

.dialog-content .length-inputs {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    justify-content: center;
}

.dialog-content .input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.dialog-content .input-group label {
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.dialog-content .length-input {
    width: 80px;
    padding: 10px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
}

.dialog-content .length-input:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.dialog-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.dialog-buttons .btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    min-width: 100px;
    transition: all 0.2s;
}

.dialog-buttons .btn-primary {
    background: #000000;
    color: #ffffff;
}

.dialog-buttons .btn-primary:hover {
    background: #333333;
}

.dialog-buttons .btn-secondary {
    background: #e5e5e5;
    color: #171717;
}

.dialog-buttons .btn-secondary:hover {
    background: #f2f2f2;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .sidebar {
        width: 260px;
    }

    .header h1 {
        font-size: 20px;
    }

    .header-logo {
        max-height: 50px;
        max-width: 250px;
    }

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

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        max-height: 300px;
    }

    .canvas-section {
        order: -1;
    }

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

    .header-left {
        justify-content: center;
    }

    .header-logo {
        max-height: 40px;
        max-width: 200px;
    }

    .header-right {
        width: 100%;
        justify-content: center;
    }
}

/* High DPI Display Support */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    #flooringCanvas {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background: #f2f2f2;
        color: #e0e0e0;
    }

    .app-container {
        background: #f2f2f2;
    }

    .sidebar {
        background: #fafafa;
        border-color: #e5e5e5;
    }

    .tool-section {
        border-color: #e5e5e5;
    }

    .tool-btn {
        background: #e5e5e5;
        border-color: #555;
        color: #e0e0e0;
    }

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

    .flooring-item {
        background: #404040;
        border-color: #555;
        color: #e0e0e0;
    }

    .canvas-header {
        background: #2d2d2d;
        border-color: #404040;
    }

    .status-bar {
        background: #2d2d2d;
        border-color: #404040;
    }

    .project-item {
        background: #404040;
        border-color: #555;
    }

    .modal-content {
        background: #fafafa;
        color: #171717;
    }

    .modal-header {
        border-color: #e5e5e5;
    }

    .modal-footer {
        border-color: #e5e5e5;
    }
}

/* Estimate Modal Styles */
.estimate-modal-content {
    width: 90%;
    height: 90%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
}

.estimate-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    padding: 0;
}

.estimate-canvas-container {
    flex: 1;
    background: #f0f0f0;
    position: relative;
    overflow: hidden;
}

#estimateKonvaMount {
    width: 100%;
    height: 100%;
}

.estimate-sidebar {
    width: 300px;
    background: #fff;
    border-left: 1px solid #ddd;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.estimate-wall-inputs {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
}

.wall-input-group {
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

.wall-input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #495057;
}

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

.wall-input-row input {
    width: 80px;
    padding: 5px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.wall-input-row span {
    color: #6c757d;
}

.estimate-actions {
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.estimate-actions button {
    width: 100%;
    padding: 10px;
    font-size: 1.1em;
}

/* Sidebar and Tool Styles */
.sidebar {
    width: 280px;
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    padding: 12px;
    overflow-y: auto;
    flex-shrink: 0;
}

.left-sidebar {
    border-right: 1px solid #e9ecef;
}

.tool-section {
    margin-bottom: 12px;
}

.tool-section h3 {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tool-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.tool-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 6px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #495057;
    min-height: 60px;
}

.tool-btn:hover:not(:disabled) {
    background: #e9ecef;
    border-color: #ced4da;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.tool-btn.active {
    background: #e3f2fd;
    border-color: #2196f3;
    color: #2196f3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.tool-btn i {
    font-size: 18px;
    margin-bottom: 4px;
}

.tool-btn span {
    font-size: 11px;
    font-weight: 500;
}

.tool-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8f9fa;
    transform: none;
    box-shadow: none;
}

/* Room Selection Styles */
.room-selection-window {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 6px;
    max-height: 120px;
    overflow-y: auto;
    margin-bottom: 8px;
}

.room-selection-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid transparent;
}

.room-selection-item:hover {
    background: #f8f9fa;
}

.room-selection-item.selected {
    background: #e3f2fd;
    border-color: #2196f3;
}

.room-selection-item .flooring-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.room-selection-item .room-info {
    flex: 1;
    min-width: 0;
}

.room-selection-item .room-name {
    font-weight: 500;
    font-size: 12px;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.room-selection-item .room-details {
    font-size: 10px;
    color: #666;
}

.room-selection-item .active-badge {
    background: #2196f3;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
}

.room-selection-actions {
    display: flex;
    gap: 6px;
}

.room-selection-actions .btn {
    flex: 1;
    justify-content: center;
}

/* Canvas Container Styles */
.canvas-container {
    position: relative;
    flex: 1;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #fff;
}

#konvaContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    /* Konva is the primary drawing system - ensure it's always on top */
    pointer-events: auto;
    /* Ensure visibility */
    display: block;
    visibility: visible;
}

#konvaMount {
    width: 100%;
    height: 100%;
}

.canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none !important;
    z-index: 10;
}

#flooringCanvas {
    position: absolute;
    top: 0;
    left: 0;
    display: none !important;
    visibility: hidden !important;
    z-index: -1;
    pointer-events: none !important;
}

/* Hide all Fabric.js created canvas elements to prevent phantom shapes */
/* Fabric.js creates wrapper divs with class 'canvas-container' that contain canvases */
.canvas-container > .canvas-container,
.canvas-container .lower-canvas,
.canvas-container .upper-canvas {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.canvas-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 400px;
}

/* Canvas Header - Must be above Konva canvas */
.canvas-header {
    position: relative;
    z-index: 1000;
    background: #2c2c2c;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #444;
    pointer-events: auto !important;
}

.canvas-controls {
    display: flex;
    gap: 6px;
    align-items: center;
    position: relative;
    z-index: 1001;
}

.canvas-controls .btn {
    min-width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #444;
    border: 1px solid #555;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    pointer-events: auto !important;
    position: relative;
    z-index: 1002;
}

.canvas-controls .btn:hover:not(:disabled) {
    background: #555;
    border-color: #666;
}

.canvas-controls .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: auto !important;
}

.canvas-info {
    display: flex;
    gap: 16px;
    color: #737373;
    font-size: 12px;
}

.canvas-info span {
    padding: 4px 8px;
    background: #333;
    border-radius: 3px;
}

/* ===== SPECIFY OVERLAY - DARK THEME (Matching Main App) ===== */

.specify-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #171717;
    z-index: 10000;
    display: flex;
}

.specify-fw-container {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Left Panel - Keypad */
.specify-fw-left {
    /* Wide enough for two 3-column keypads of 44px touch keys
       (2 x 142px + 8px gap + 2 x 12px padding) without spilling
       under the drawing panel. */
    width: 320px;
    flex: 0 0 320px;
    box-sizing: border-box;
    background: #fafafa;
    border-right: 1px solid #e5e5e5;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    overflow-x: hidden;
}

.specify-fw-title {
    color: #000000;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    padding: 5px;
}

/* Navigation Arrows */
.specify-fw-nav {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.specify-fw-arrow {
    width: 30px;
    height: 25px;
    background: #f2f2f2;
    border: 1px solid #000000;
    color: #000000;
    cursor: pointer;
    font-size: 12px;
}

.specify-fw-arrow:hover {
    background: #000000;
    color: #171717;
}

/* Spinner Input Row */
.specify-fw-inputs {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 5px 0;
}

.specify-fw-input-group {
    display: flex;
    align-items: center;
    gap: 3px;
}

.specify-fw-spinner {
    width: 50px;
    height: 22px;
    font-size: 12px;
    text-align: center;
    border: 1px solid #000000;
    background: #f2f2f2;
    color: #fff;
}

.specify-fw-unit {
    font-size: 12px;
    color: #000000;
}

/* Two Keypads Side by Side */
.specify-fw-keypads {
    display: flex;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.specify-fw-keypad {
    display: grid;
    grid-template-columns: repeat(3, 44px);
    gap: 2px;
    border: 1px solid #e5e5e5;
    padding: 2px;
    background: #fafafa;
    flex: 0 0 auto;
}

.specify-fw-key {
    /* Matches the global 44px touch target so the grid math above holds */
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    font-size: 14px;
    font-weight: normal;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    color: #171717;
    cursor: pointer;
}

.specify-fw-key:hover {
    background: #f2f2f2;
    border-color: #d4d4d4;
}

.specify-fw-key:active {
    background: #e5e5e5;
}

.specify-fw-key-wide {
    grid-column: span 3;
    width: auto;
}

/* Checkbox Row */
.specify-fw-checkbox {
    padding: 5px 0;
}

.specify-fw-checkbox label {
    font-size: 11px;
    color: #737373;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.specify-fw-checkbox input {
    width: 14px;
    height: 14px;
}

/* Reset / Undo Buttons */
.specify-fw-buttons {
    display: flex;
    gap: 5px;
}

.specify-fw-btn {
    flex: 1;
    padding: 6px 10px;
    font-size: 12px;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    color: #171717;
    cursor: pointer;
}

.specify-fw-btn:hover {
    background: #f2f2f2;
    border-color: #d4d4d4;
}

/* Done / Cancel Buttons at Bottom */
.specify-fw-actions {
    margin-top: auto;
    display: flex;
    gap: 5px;
}

.specify-fw-cancel {
    background: #ffffff;
    color: #dc2626;
    border-color: #dc2626;
}

.specify-fw-cancel:hover {
    background: #dc2626;
    color: #fff;
}

.specify-fw-done {
    background: #ffffff;
    color: #16a34a;
    border-color: #16a34a;
}

.specify-fw-done:hover:not(:disabled) {
    background: #4CAF50;
    color: #fff;
}

.specify-fw-done:disabled {
    color: #a3a3a3;
    border-color: #e5e5e5;
    cursor: not-allowed;
}

/* =====================================================================
   Island/Pole "Include openings?" blocking prompt
   - Fires immediately after an island/pole is placed.
   - The user MUST pick Yes or No. No close X, no Esc, no backdrop click.
   ===================================================================== */
.island-include-openings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Semi-transparent backdrop so the placed island stays slightly visible. */
    background: rgba(0, 0, 0, 0.55);
    z-index: 11000; /* above specify-overlay (10000) so it always wins if both open */
    display: flex;
    align-items: center;
    justify-content: center;
    /* Block all pointer events on the page behind by capturing them on the backdrop. */
}

.island-include-openings-card {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
    padding: 24px 28px;
    width: min(440px, calc(100% - 32px));
    text-align: center;
    font-family: inherit;
}

.island-include-openings-title {
    font-size: 20px;
    font-weight: 700;
    color: #111111;
    margin-bottom: 10px;
}

.island-include-openings-body {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.45;
    margin-bottom: 22px;
}

.island-include-openings-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.island-include-openings-btn {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.island-include-openings-yes {
    background: #FFCC00;
    color: #111111;
    border: 2px solid #d4a800;
}

.island-include-openings-yes:hover {
    background: #ffd633;
}

.island-include-openings-no {
    background: #ffffff;
    color: #111111;
    border: 2px solid #111111;
}

.island-include-openings-no:hover {
    background: #111111;
    color: #ffffff;
}

/* Apply Suggestions Button (Floor Wizard orange style) */
.specify-fw-suggest {
    width: 100%;
    margin-top: 10px;
    padding: 10px 15px;
    font-size: 13px;
    font-weight: bold;
    background: linear-gradient(180deg, #ff9800 0%, #e65100 100%);
    border: 2px solid #ffb74d;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

.specify-fw-suggest:hover {
    background: linear-gradient(180deg, #ffb74d 0%, #ff9800 100%);
    border-color: #ffd54f;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.4);
}

.specify-fw-suggest:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Right Panel - Room Preview */
.specify-fw-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #171717;
}

.specify-fw-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    background: #fafafa;
    border-bottom: 1px solid #000000;
    font-size: 11px;
}

.specify-fw-header label {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #737373;
    cursor: pointer;
}

.specify-fw-header input {
    width: 14px;
    height: 14px;
}

.specify-fw-room-name {
    font-weight: bold;
    color: #000000;
    font-size: 14px;
}

.specify-fw-canvas-wrap {
    flex: 1;
    background: #ffffff;
    border: 2px solid #000000;
    margin: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#specifyCanvas {
    background: #ffffff;
}

.specify-fw-progress {
    padding: 5px 10px;
    background: #fafafa;
    border-top: 1px solid #000000;
    font-size: 11px;
    color: #000000;
    text-align: center;
}

/* Tab lock styles */
.tab-btn.tab-locked {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

.tab-lock-message {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Level selector dropdown */
.level-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 16px;
}

.level-selector label {
    color: #737373;
    font-size: 12px;
}

.level-dropdown {
    background: #444;
    color: #fff;
    border: 1px solid #000000;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
}

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

.level-dropdown:hover:not(:disabled) {
    background: #555;
}

/* ===== TEMPLATE PANEL ===== */

.expand-checkbox {
    float: right;
    font-size: 12px;
    font-weight: normal;
    color: #737373;
    cursor: pointer;
}

.expand-checkbox input {
    margin-right: 4px;
}

.template-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.template-panel.expanded {
    max-height: 300px;
    overflow-y: auto;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 8px 0;
}

.template-item {
    background: #3a4a5a;
    border: 2px solid #4a5a6a;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    cursor: grab;
    transition: all 0.2s;
}

.template-item:hover {
    background: #4a5a6a;
    border-color: #000000;
}

.template-item:active {
    cursor: grabbing;
}

.template-item svg {
    width: 40px;
    height: 40px;
    margin-bottom: 4px;
}

.template-item span {
    display: block;
    font-size: 11px;
    color: #737373;
}

.template-item.dragging {
    opacity: 0.5;
}

/* Template drag preview */
.template-drag-preview {
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    opacity: 0.8;
}

.template-drag-preview svg {
    width: 60px;
    height: 60px;
}

/* Room action buttons grid */
.room-action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.room-action-grid .btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    min-height: 50px;
}

.room-action-grid .btn i {
    font-size: 16px;
    margin-bottom: 4px;
}

.room-action-grid .btn span {
    font-size: 11px;
}

/* Clipboard status indicator */
.clipboard-status {
    background: #2a4a2a;
    border: 1px solid #000000;
    border-radius: 4px;
    padding: 8px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #000000;
}

.clipboard-status i {
    font-size: 14px;
}

/* ===== COMPACT DRAW TAB LAYOUT - FLOOR WIZARD STYLE ===== */

.draw-layout-compact {
    display: flex;
    height: calc(100vh - 150px);
    overflow: hidden;
    background: #ffffff;
}

/* Compact Left Sidebar */
.sidebar-compact {
    width: 275px;
    min-width: 275px;
    background: #fafafa;
    border-right: 1px solid #e5e5e5;
    padding: 4px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

/* No rooms yet: templates, Create Template, copy/paste and every Room Action are
   greyed out and inert until a room is added from Room Details. */
.sidebar-compact.no-rooms .template-grid-compact,
.sidebar-compact.no-rooms .create-template-btn,
.sidebar-compact.no-rooms .clipboard-preview-container,
.sidebar-compact.no-rooms .sidebar-btn-row,
.sidebar-compact.no-rooms .sidebar-bottom {
    opacity: 0.45;
    pointer-events: none;
    user-select: none;
}

/* Sidebar top section - takes available space */
.sidebar-top {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 auto; /* Fill available space above sidebar-bottom */
    min-height: 0;  /* ...but shrink (template list gets smaller) so the tools never scroll off */
}

/* Sidebar bottom section - pushed to bottom, never squeezed */
.sidebar-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 4px;
    border-top: 1px solid #e5e5e5;
    flex: 0 0 auto;
}

.sidebar-compact::-webkit-scrollbar {
    width: 4px;
}

.sidebar-compact::-webkit-scrollbar-track {
    background: #fafafa;
}

.sidebar-compact::-webkit-scrollbar-thumb {
    background: #d4d4d4;
}

.sidebar-compact::-webkit-scrollbar-thumb:hover {
    background: #a3a3a3;
}

.sidebar-section {
    padding: 2px 0;
}

.sidebar-label {
    display: block;
    font-size: 9px;
    color: #171717 !important;
    font-weight: bold;
    margin-bottom: 2px;
}

/* Ensure all sidebar section headers are light text */
.sidebar-compact label,
.sidebar-compact .sidebar-label,
.sidebar-section > label {
    color: #171717 !important;
}

/* Template List Title - Light text */
.template-list-title {
    color: #171717;
    font-size: 10px;
    font-weight: bold;
}

/* Template grid always visible */
.template-always-show {
    display: grid !important;
}

/* Active Tool Display - Red text */
.active-tool-display {
    color: #cc0000;
    font-weight: bold;
    font-size: 12px;
    margin-left: 15px;
    white-space: nowrap;
}

.sidebar-select {
    width: 100%;
    padding: 2px 4px;
    font-size: 10px;
    border: 1px solid #e5e5e5;
    background: #ffffff;
    color: #171717;
}

.template-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 9px;
    color: #171717;
    cursor: pointer;
    margin-bottom: -3px; /* Shift content below up by 3px */
}

.template-toggle input {
    width: 12px;
    height: 12px;
}

/* Template Grid - Floor Wizard Style */
.template-grid-compact {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding: 2px;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    margin-top: 0;
    /* Flexible: grows to show templates when there is room, shrinks (and
       scrolls internally) on short windows so every tool below stays visible */
    flex: 1 1 auto;
    min-height: 60px;
    max-height: 210px;
    overflow-y: auto;
    overflow-x: hidden;
    align-content: start;
}

/* Template always show - override any hidden state */
.template-grid-compact.template-always-show {
    display: grid !important;
}

.template-grid-compact.expanded {
    max-height: none;
}

/* Create Template Button */
.create-template-btn {
    width: 100%;
    padding: 4px 6px;
    font-size: 9px;
    background: #e5e5e5;
    border: 1px solid #d4d4d4;
    cursor: pointer;
    color: #171717;
    margin-top: 3px;
    border-radius: 2px;
    text-align: center;
}

.create-template-btn:hover:not(:disabled) {
    background: #000000;
    color: #ffffff;
}

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

/* Saved Template Items in grid */
.tpl-saved-item {
    width: 75px;
    height: 75px;
    border: 1px solid #e5e5e5;
    background: #fafafa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.tpl-saved-item:hover {
    background: #000000;
    border-color: #000000;
}

.tpl-saved-item:hover svg line,
.tpl-saved-item:hover svg polyline {
    stroke: #ffffff;
}

.tpl-saved-item.active {
    background: #000000;
    border-color: #000000;
}

.tpl-saved-item.active svg line,
.tpl-saved-item.active svg polyline {
    stroke: #ffffff;
}

.tpl-saved-item svg {
    width: 65px;
    height: 65px;
    /* !important: a global `* { pointer-events: auto !important }` rule
       earlier in this file would otherwise win. */
    pointer-events: none !important;
}

/* Long-press + drag reordering. pan-y keeps normal finger-scrolling of the
   list working; once a hold turns into a reorder, renderer.js cancels the
   browser pan itself (non-passive touchmove + preventDefault). */
.tpl-saved-item {
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
}

.template-grid-compact.tpl-reordering .tpl-saved-item {
    cursor: grabbing;
    transition: transform 120ms ease;
}

.template-grid-compact.tpl-reordering .tpl-saved-item:hover {
    background: #fafafa;
    border-color: #e5e5e5;
}

.template-grid-compact.tpl-reordering .tpl-saved-item:hover svg line,
.template-grid-compact.tpl-reordering .tpl-saved-item:hover svg polyline {
    stroke: #737373;
}

/* The tile being moved: stays in the grid as a faded slot marker */
.tpl-saved-item.tpl-dragging {
    opacity: 0.25;
    border-style: dashed;
    border-color: #171717;
}

/* Floating copy that follows the pointer */
.tpl-drag-ghost,
.tpl-drag-ghost * {
    pointer-events: none !important;
}
.tpl-drag-ghost {
    position: fixed;
    z-index: 100000;
    background: #ffffff;
    border: 1px solid #171717;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    transform: scale(1.05);
    opacity: 0.95;
}

/* Create/Delete template button - delete mode */
.create-template-btn.delete-mode {
    background: #dc3545;
    border-color: #dc3545;
    color: #ffffff;
}

.create-template-btn.delete-mode:hover:not(:disabled) {
    background: #a71d2a;
}

/* Create button while a built-in (non-deletable) template is selected */
.create-template-btn.default-mode,
.create-template-btn.default-mode:disabled {
    background: #f5f5f5;
    border-color: #d4d4d4;
    color: #737373;
    opacity: 1;
    cursor: default;
}

/* Clipboard Preview Container */
.clipboard-preview-container {
    max-height: 83px; /* 1 row of 75px items + padding/borders */
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid #e5e5e5;
    border-radius: 2px;
    background: #fafafa;
    display: none; /* Hidden when empty, shown via JS */
}

.clipboard-preview-container.has-items {
    display: block;
    margin-bottom: 2px;
}

.clipboard-preview-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    height: 75px;
    box-sizing: border-box;
    cursor: pointer;
    border-bottom: 1px solid #e5e5e5;
    transition: background 0.15s;
}

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

.clipboard-preview-item:hover {
    background: #e5e5e5;
}

.clipboard-preview-item.active {
    background: #d4edda;
    border-color: #28a745;
}

.clipboard-preview-item svg {
    width: 65px;
    height: 65px;
    flex-shrink: 0;
    border: 1px solid #e5e5e5;
    border-radius: 2px;
    background: #ffffff;
}

.clipboard-preview-label {
    font-size: 9px;
    color: #525252;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

/* Canvas placement cursor */
.canvas-placement-mode {
    cursor: crosshair !important;
}

.tpl-item {
    width: 28px;
    height: 28px;
    border: 1px solid #e5e5e5;
    background: #fafafa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tpl-item:hover {
    background: #000000;
    border-color: #000000;
}

.tpl-icon {
    width: 18px;
    height: 18px;
    border: 2px solid #737373;
}

.tpl-icon.sq { }
.tpl-icon.rect { width: 20px; height: 12px; }
.tpl-icon.l-shape { border: none; border-left: 2px solid #737373; border-bottom: 2px solid #737373; border-right: 2px solid #737373; width: 16px; height: 16px; position: relative; }
.tpl-icon.l-shape::after { content: ''; position: absolute; top: 0; right: 0; width: 8px; height: 8px; border-top: 2px solid #737373; border-right: 2px solid #737373; }
.tpl-icon.t-shape { border-bottom: none; }
.tpl-icon.u-shape { border-top: none; }
.tpl-icon.custom { border-radius: 4px; }
.tpl-icon.stairs { background: repeating-linear-gradient(90deg, #737373, #737373 2px, transparent 2px, transparent 4px); }
.tpl-icon.closet { width: 12px; }
.tpl-icon.bay { border-radius: 0 0 50% 50%; height: 14px; }
.tpl-icon.alcove { width: 14px; height: 10px; }
.tpl-icon.corner { border-left: none; border-bottom: none; }
.tpl-icon.angled { transform: skewX(-10deg); }

/* Sidebar Button Row */
.sidebar-btn-row {
    display: flex;
    gap: 2px;
}

.sidebar-btn {
    flex: 1;
    padding: 3px 4px;
    font-size: 9px;
    background: #e5e5e5;
    border: 1px solid #e5e5e5;
    cursor: pointer;
    color: #171717;
}

.sidebar-btn:hover:not(:disabled) {
    background: #000000;
    color: #ffffff;
}

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

/* Room Actions Grid - All Tools in One Place */
.room-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
}

.ra-btn {
    padding: 4px 2px;
    font-size: 9px;
    background: #e5e5e5;
    border: 1px solid #e5e5e5;
    cursor: pointer;
    text-align: center;
    color: #171717;
}

.ra-btn:hover:not(:disabled) {
    background: #000000;
    color: #ffffff;
}

.ra-btn:disabled {
    opacity: 0.5;
}

/* Wall button - Black with white text */
.ra-btn[data-tool="wall"] {
    background: #000000;
    color: #ffffff;
    border-color: #333;
}

/* Door button - Blue (matches drawn doors) with white text */
.ra-btn.door-btn, .ra-btn[data-tool="door"] {
    background: #0066FF;
    color: #ffffff;
    border-color: #0052cc;
}

/* Opening button - Yellow with black text */
.ra-btn.opening-btn, .ra-btn[data-tool="opening"] {
    background: #ffc107;
    color: #000000;
    border-color: #d39e00;
}

/* Window button - Purple with white text */
.ra-btn.window-btn, .ra-btn[data-tool="window"] {
    background: #8B00FF;
    color: #ffffff;
    border-color: #6a00cc;
}

/* Remove button - Red with white text */
.ra-btn[data-tool="remove"] {
    background: #dc3545;
    color: #ffffff;
    border-color: #c82333;
}

/* Clear button - Red with white text */
#clearRoomBtn {
    background: #dc3545;
    color: #ffffff;
    border-color: #c82333;
}

/* Move button - Normal (not greyed) */
.ra-btn[data-tool="move"], #moveBtn {
    background: #6c757d;
    color: #ffffff;
    border-color: #545b62;
}

/* Rotate button - Dark Teal with white text */
.ra-btn[data-tool="rotate"], #rotateBtn {
    background: #008080;
    color: #ffffff;
    border-color: #006666;
}

/* Mirror button - Dark Blue with white text */
.ra-btn[data-tool="mirror"], #mirrorBtn {
    background: #00008B;
    color: #ffffff;
    border-color: #000066;
}

/* Flip button - Light Orange with black text */
#flipBtn {
    background: #FFB347;
    color: #000000;
    border-color: #e69500;
}

/* Transform button active states - bright cyan border and glow */
#mirrorBtn.active,
#rotateBtn.active,
#flipBtn.active {
    box-shadow: 0 0 10px 2px #000000, inset 0 0 0 2px #000000;
    border-color: #000000 !important;
}

/* Undo button in sidebar - Match zoom buttons style */
#undoBtnSidebar {
    background: #f2f2f2;
    color: #000000;
    border-color: #000000;
}

/* Specify button - Green when enabled */
.ra-btn.specify-btn, #specifyBtn {
    background: #4CAF50;
    color: #ffffff;
    border-color: #388E3C;
}

.ra-btn.specify-btn:disabled, #specifyBtn:disabled {
    background: #e5e5e5;
    color: #737373;
    border-color: #e5e5e5;
}

/* Island/Pole row - sits above the main room-actions-grid (separator gap) */
.island-pole-row {
    margin-bottom: 4px;
}

/* Island/Pole drag tool button - Teal */
.ra-btn.island-pole-btn, #islandPoleBtn {
    background: #17a2b8;
    color: #ffffff;
    border-color: #138496;
}

.ra-btn.island-pole-btn:hover:not(:disabled),
#islandPoleBtn:hover:not(:disabled) {
    background: #117a8b;
    color: #ffffff;
}

.ra-btn.island-pole-btn:disabled,
#islandPoleBtn:disabled {
    background: #e5e5e5;
    color: #737373;
    border-color: #e5e5e5;
}

/* Specify Island/Pole button - Green when enabled, mirrors specify-btn */
.ra-btn.specify-island-btn, #specifyIslandPoleBtn {
    background: #4CAF50;
    color: #ffffff;
    border-color: #388E3C;
}

.ra-btn.specify-island-btn:hover:not(:disabled),
#specifyIslandPoleBtn:hover:not(:disabled) {
    background: #388E3C;
    color: #ffffff;
}

.ra-btn.specify-island-btn:disabled,
#specifyIslandPoleBtn:disabled {
    background: #e5e5e5;
    color: #737373;
    border-color: #e5e5e5;
}

/* Remove Island/Pole button - Red, mirrors data-tool="remove" */
.ra-btn.remove-island-btn, #removeIslandPoleBtn {
    background: #dc3545;
    color: #ffffff;
    border-color: #c82333;
}

.ra-btn.remove-island-btn:hover:not(:disabled),
#removeIslandPoleBtn:hover:not(:disabled) {
    background: #c82333;
    color: #ffffff;
}

/* Island lock message banner - mirrors #tabLockMessage style */
#islandLockMessage {
    background: #ff6b6b;
    color: #ffffff;
    padding: 8px 16px;
    text-align: center;
    font-size: 14px;
    position: fixed;
    top: 92px;
    left: 0;
    right: 0;
    z-index: 9999;
    font-weight: 600;
}

/* Canvas Section for compact layout - takes full remaining width */
.draw-layout-compact .canvas-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fafafa;
    min-width: 0; /* Allow shrinking */
    width: 100%; /* Fill available space */
}

.draw-layout-compact .canvas-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    padding: 4px 8px;
}

.draw-layout-compact .canvas-controls {
    gap: 2px;
}

.draw-layout-compact .canvas-controls .btn {
    padding: 3px 6px;
    font-size: 11px;
}

.draw-layout-compact .canvas-container {
    flex: 1;
    background: #fff;
    margin: 4px;
    border: 1px solid #e5e5e5;
    width: calc(100% - 8px); /* Account for margins */
}

/* Legacy support for old layout */
.draw-layout {
    display: flex;
    height: calc(100vh - 150px);
    overflow: hidden;
}

.left-sidebar {
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px !important;
}

/* Legacy compact template grid */
.template-grid {
    gap: 4px !important;
    padding: 4px 0 !important;
}

.template-item {
    padding: 4px !important;
}

.template-item svg {
    width: 30px !important;
    height: 30px !important;
    margin-bottom: 2px !important;
}

.template-item span {
    font-size: 9px !important;
}

/* Ensure canvas takes remaining space */
.canvas-section {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

/* Compact right sidebar */
.right-sidebar {
    max-height: 100%;
    overflow-y: auto;
    padding: 8px !important;
}

/* Hide scrollbars on small screens if content fits */
@media (max-height: 800px) {
    .left-sidebar {
        overflow-y: auto;
    }
    
    .room-selection-window {
        max-height: 60px !important;
    }
    
    .template-panel.expanded {
        max-height: 100px !important;
    }
}

/* ============================================
   Floor Plan Details Table (Floor Wizard style)
   ============================================ */
.floor-plan-details-container {
    margin-top: 15px;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
}

.floor-plan-table-title {
    background: #ffffff;
    color: #000000;
    margin: 0;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 1px solid #e5e5e5;
}

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

.floor-plan-details-table thead {
    background: #fafafa;
}

.floor-plan-details-table th {
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: #171717;
    border-bottom: 2px solid #e5e5e5;
}

.floor-plan-details-table tbody tr {
    background: #ffffff;
}

.floor-plan-details-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.floor-plan-details-table tbody tr:hover {
    background: #e5e5e5;
}

.floor-plan-details-table td {
    padding: 6px 12px;
    border-bottom: 1px solid #e5e5e5;
    color: #171717;
}

.floor-plan-details-table td.level-cell {
    background: #e5e5e5;
    font-weight: 500;
}

.floor-plan-details-table td.id-cell {
    background: #171717;
    color: #fff;
    font-weight: 600;
    text-align: center;
    width: 40px;
}

.floor-plan-details-table td.order-qty {
    color: #c00;
    font-weight: 500;
}

/* ============================================
   Cost Tab Styles
   ============================================ */
#cost-panel {
    overflow-y: auto;
    max-height: 100%;
}

.cost-content {
    padding: 20px;
    max-width: 900px;
    margin: 0 auto;
    background: #ffffff;
}

.cost-content h2 {
    color: #171717;
    margin-bottom: 20px;
    font-size: 24px;
    border-bottom: 2px solid #000000;
    padding-bottom: 10px;
}

.cost-content .summary-calculations-section,
.cost-content .summary-charges-section,
.cost-content .summary-transitions-section,
.cost-content .discount-section {
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.cost-content .summary-calculations-section h3,
.cost-content .summary-charges-section h3,
.cost-content .summary-transitions-section h3 {
    color: #171717;
    font-size: 18px;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e5e5;
}

.cost-content .final-total-section {
    background: linear-gradient(135deg, #fafafa 0%, #e5e5e5 100%);
    border: 1px solid #000000;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

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

.cost-content .final-label {
    color: #171717;
    font-size: 20px;
    font-weight: 600;
}

.cost-content .final-value {
    color: #000000;
    font-size: 28px;
    font-weight: 700;
}

/* ============================================
   Room Layouts Sub-tab (Floor Wizard style)
   ============================================ */
.room-layouts-content {
    padding: 20px;
    background: #ffffff;
}

.room-layouts-content h3 {
    color: #171717;
    margin: 0 0 5px 0;
    font-size: 18px;
}

.room-layouts-content .help-text {
    color: #737373;
    font-size: 13px;
    margin: 0 0 15px 0;
}

.room-layouts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 15px;
}

.no-rooms-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #888;
    font-style: italic;
}

.room-layout-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s ease;
}

.room-layout-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.room-layout-canvas {
    display: block;
    width: 100%;
    height: auto;
    border-bottom: 1px solid #eee;
}

.room-layout-header {
    background: #171717;
    color: #fff;
    padding: 8px 12px;
    font-weight: 600;
    font-size: 14px;
}

.room-layout-info {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    font-size: 13px;
    color: #555;
    background: #f5f5f5;
}

/* ============================================
   Draw-tab native scrollbars (Option 1)
   ============================================
   The Konva world is infinite (no clamp on cameraWorldOrigin), so we add
   two thin overflow-scroll proxies along the right and bottom edges of the
   draw canvas. The inner spacers are resized in JS to:
       (world content bbox U camera viewport) * pxPerFoot
   so REAL native scrollbars appear when there's content / pan to scroll
   through. renderer.js (DrawCanvasScrollbars) keeps the bars in lock-step
   with the Konva viewport via a scroll <-> setCameraWorldOrigin bridge.

   Notes:
   - These rules only affect the Draw tab because that's the only ancestor
     using the bare `.canvas-container` class (the other tabs use scoped
     classes like `.transitions-canvas-container`, `.estimate-canvas-container`).
   - We shrink #konvaContainer by 14px on the right and bottom so the
     canvas never paints under the scrollbar tracks. The 14x14 corner
     between the two bars is intentionally left blank.
   - On macOS the default overlay scrollbars auto-hide; the explicit
     ::-webkit-scrollbar block forces visible scrollbars on Chromium/
     Electron, and `scrollbar-width`/`scrollbar-color` does the same on
     Firefox. */

#konvaContainer {
    /* Reserve a 14px gutter on the right and bottom edges of the canvas
       container for the scroll proxies below. Overrides the earlier
       width/height:100% rule. */
    right: 14px;
    bottom: 14px;
    width: auto;
    height: auto;
}

.konva-scrollbar {
    position: absolute;
    z-index: 15; /* above #konvaContainer (z 10) so the scrollbar track paints on top */
    background: transparent;
    /* No `pointer-events: none` -- we WANT clicks on the scrollbar track
       and thumb to navigate. The proxy element is otherwise empty (only
       contains a 1x1 spacer); clicks land on the native scrollbar UI. */
}

.konva-scrollbar-y {
    top: 0;
    right: 0;
    bottom: 14px;     /* leave the corner where the horizontal scrollbar sits */
    width: 14px;
    overflow-y: scroll;
    overflow-x: hidden;
}

.konva-scrollbar-x {
    left: 0;
    bottom: 0;
    right: 14px;      /* leave the corner where the vertical scrollbar sits */
    height: 14px;
    overflow-x: scroll;
    overflow-y: hidden;
}

/* The spacers are sized dynamically by JS. The 1px fallback prevents the
   scrollbar from rendering a "1px scrollable" state on first paint. */
.konva-scrollbar-spacer-y {
    width: 1px;
    height: 1px;
}
.konva-scrollbar-spacer-x {
    width: 1px;
    height: 1px;
}

/* Force visible Chromium / Electron scrollbars with a flat, neutral look
   that matches the rest of the toolset. */
.konva-scrollbar::-webkit-scrollbar {
    width: 14px;
    height: 14px;
}
.konva-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}
.konva-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 7px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
.konva-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.55);
    background-clip: padding-box;
    border: 2px solid transparent;
}
.konva-scrollbar::-webkit-scrollbar-corner {
    background: transparent;
}

/* Firefox: thin scrollbar with matching neutral colors. */
.konva-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.35) rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   Measure status: badges, header pill, Save & Exit page, Versions popup, lock
   ========================================================================== */

/* Status badges (project lists + header pill) */
.measure-status-badge,
.measure-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
    line-height: 1.4;
}
.measure-status-badge.incomplete,
.measure-status-pill.incomplete {
    background: rgba(220, 38, 38, 0.18);     /* transparent red */
    color: #000000;
    border: 1px solid rgba(220, 38, 38, 0.35);
}
.measure-status-badge.complete,
.measure-status-pill.complete {
    background: rgba(22, 163, 74, 0.22);     /* transparent green */
    color: #000000;
    border: 1px solid rgba(22, 163, 74, 0.4);
}
.measure-status-badge.invalid,
.measure-status-pill.invalid {
    background: #991b1b;                     /* deep red */
    color: #ffffff;
    border: 1px solid #7f1d1d;
}
.measure-status-badge .sub,
.measure-status-pill .sub {
    font-weight: 500;
    opacity: .8;
}
.measure-status-pill {
    margin-right: 6px;
    align-self: center;
}

/* Complete measures are read-only until a new version is created */
body.measure-locked .main-content .tab-panel {
    pointer-events: none;
    user-select: none;
}
body.measure-locked .main-content .tab-panel.active {
    opacity: .92;
}
body.measure-locked .tab-navigation::after {
    content: "Complete - read only. Use Versions to make changes.";
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    padding: 0 14px;
    font-size: 12px;
    font-weight: 600;
    color: #166534;
}

/* Save & Exit page */
.measure-exit-page {
    position: fixed;
    inset: 0;
    z-index: 10500;
    background: rgba(10, 25, 47, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.mep-card {
    background: #fafafa;
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    width: min(960px, 96vw);
    max-height: 94vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.mep-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid #e5e5e5;
    background: #f2f2f2;
}
.mep-header h2 {
    margin: 0;
    font-size: 20px;
    color: #171717;
    text-align: center;
}
.mep-back {
    justify-self: start;
    background: none;
    border: none;
    color: #737373;
    font-size: 13px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    min-height: 0;
    min-width: 0;
}
.mep-back:hover { background: #e5e5e5; color: #171717; }
.mep-customer {
    justify-self: end;
    font-size: 13px;
    color: #737373;
    font-weight: 600;
}
.mep-body {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}
.mep-left {
    border-right: 1px solid #e5e5e5;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #ffffff;
}
.mep-right {
    padding: 18px 24px;
}
.mep-col-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #737373;
    margin-bottom: 4px;
}
.mep-sub-title {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e5e5e5;
}
.mep-groups, .mep-subs {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.mep-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    background: #fafafa;
    color: #171717;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
    min-width: 0;
}
.mep-option:hover { background: #f2f2f2; border-color: #d4d4d4; }
.mep-option.selected {
    background: #000000;
    border-color: #000000;
    color: #ffffff;
}
.mep-option .hint {
    font-size: 12px;
    font-weight: 500;
    color: #737373;
}
.mep-option.selected .hint { color: #d4d4d4; }
.mep-checklist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mep-checklist li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
    background: #ffffff;
    font-size: 15px;
    font-weight: 600;
}
.mep-checklist li i { width: 18px; text-align: center; }
.mep-checklist li .why {
    margin-left: auto;
    font-size: 12px;
    font-weight: 500;
    color: #737373;
    text-align: right;
}
.mep-checklist li.ok { color: #15803d; border-color: rgba(22, 163, 74, 0.35); }
.mep-checklist li.missing { color: #b91c1c; border-color: rgba(220, 38, 38, 0.35); }
.mep-message {
    margin: 14px 0 0;
    min-height: 20px;
    font-size: 13px;
    color: #737373;
}
.mep-message.error { color: #b91c1c; font-weight: 600; }
.mep-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 14px 20px;
    border-top: 1px solid #e5e5e5;
    background: #f2f2f2;
}
@media (max-width: 720px) {
    .mep-body { grid-template-columns: 1fr; }
    .mep-left { border-right: none; border-bottom: 1px solid #e5e5e5; }
}

/* Versions popup */
.versions-popup { width: min(720px, 94vw); }
.versions-popup .transform-popup-body { text-align: left; }
.versions-table-wrap {
    max-height: 46vh;
    overflow: auto;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    background: #ffffff;
}
.versions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.versions-table th, .versions-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
    color: #171717;
    vertical-align: middle;
}
.versions-table th {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #737373;
}
.versions-table tbody tr { cursor: pointer; }
.versions-table tbody tr:hover td { background: #f5f5f5; }
.versions-table tr.current td { background: rgba(22, 163, 74, 0.08); }
/* Selected row: a soft highlight + left accent (no per-cell outlines, which read as a grid) */
.versions-table tr.selected td { background: rgba(37, 99, 235, 0.08); }
.versions-table tr.selected td:first-child { box-shadow: inset 3px 0 0 #2563eb; }
.versions-table .current-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 4px;
    background: #000;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}
.versions-table .row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.versions-table .row-actions .btn { padding: 4px 10px; font-size: 12px; min-height: 30px; min-width: 0; }
.versions-footer { justify-content: flex-end; gap: 10px; }

/* ===== Centered confirmation popup (e.g. "Notes Saved") ===== */
.center-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    animation: centerPopupFade 0.18s ease-out;
}
.center-popup-overlay.closing { opacity: 0; transition: opacity 0.2s ease; }
.center-popup {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 28px;
    background: #fff;
    color: #171717;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    font-size: 18px;
    font-weight: 700;
    animation: centerPopupPop 0.2s ease-out;
}
.center-popup i { color: #16a34a; font-size: 22px; }
@keyframes centerPopupFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes centerPopupPop { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ===== Furniture / Charges tabs: click-to-select room rows (no checkboxes) ===== */
.rooms-list .select-room-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
}
.rooms-list .select-room-item.whole-project {
    font-style: italic;
    border-bottom: 2px solid #171717;
}
.rooms-list .select-room-item .select-room-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rooms-list .select-room-item .select-room-count {
    flex: 0 0 auto;
    min-width: 22px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #e5e5e5;
    color: #171717;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}
.rooms-list .select-room-item.selected .select-room-count {
    background: #ffffff;
    color: #000000;
}

/* Compact assigned rows (furniture items / charges) so more fits on screen */
.assigned-furniture-item.compact {
    padding: 5px 10px;
    margin-bottom: 3px;
    font-size: 13px;
}
.assigned-furniture-item.compact .assigned-furniture-name { gap: 0; }
.assigned-furniture-item.compact .remove-furniture-btn { padding: 0 2px; font-size: inherit; }
.assigned-furniture-items { padding: 6px; }
.assigned-room-group { margin-bottom: 10px; }
.assigned-room-header { padding: 6px 12px; font-size: 13px; }
.assigned-furniture-list { max-height: none; }

/* Charges tab in the furniture three-box layout */
.charges-three-box-container { height: calc(100vh - 260px); margin-left: 0; margin-right: 0; }
.charges-three-box-container .line-items-list,
.charges-three-box-container .applied-charges-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 6px;
    background: #ffffff;
    border: 1px solid #e5e5e5;
}
.charges-three-box-container .line-item { padding: 8px 10px; margin-bottom: 6px; }
.charges-three-box-container .line-item-description { font-size: 12px; }
.charges-three-box-container .line-item-amount { font-size: 14px; }
.charges-three-box-container .applied-charge-item.compact {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 8px 10px;
    margin-bottom: 6px;
    min-height: 0;
    box-shadow: none;
    background: #ffffff;
}
.charges-three-box-container .applied-charge-item.compact .applied-charge-header { margin-bottom: 6px; }
.charges-three-box-container .applied-charge-item.compact .applied-charge-title-row { margin-bottom: 4px; }
.charges-three-box-container .applied-charge-item.compact .applied-charge-actions {
    margin: 0;
    gap: 8px;
    align-items: center;
}
.charges-three-box-container .applied-charge-item.compact .button-stack {
    flex-direction: row;
    gap: 6px;
}
.charges-three-box-container .applied-charge-item.compact .apply-notes-btn,
.charges-three-box-container .applied-charge-item.compact .remove-charge-btn {
    width: auto;
    min-width: 0;
    padding: 5px 10px;
    font-size: 12px;
}
.charges-three-box-container .applied-charge-item.compact .notes-input { padding: 5px 8px; font-size: 13px; margin-bottom: 0; }
.charges-three-box-container .applied-charge-item.compact .applied-note-display { padding: 5px 8px; font-size: 13px; }
.charges-three-box-container .applied-charges-total { margin-top: 10px; flex: 0 0 auto; }
.charges-three-box-container .charges-room-group .assigned-furniture-items { padding: 6px; }
.charge-room { font-weight: 600; color: #171717; }
.charges-content .charges-three-box-container {
    flex: 1;
    min-height: 0;
    height: auto;
    margin-top: 12px;
}
.charges-content { max-width: none; }

/* ===== Offline project list: Send In buttons ===== */
.section-header .header-title-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.section-header .header-title-row h2 { margin: 0; }
.send-measurements-in-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #16a34a;
    color: #ffffff !important;
    border: 1px solid #15803d;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}
.send-measurements-in-btn:hover { background: #15803d; }
.send-measurements-in-btn:disabled { opacity: 0.7; cursor: wait; }
.send-measurements-in-btn i { color: #ffffff !important; }

.project-card-header { gap: 8px; }
.project-card-header .project-card-title { flex: 1; min-width: 0; }
.project-card-sendin-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #15803d;
    background: #16a34a;
    color: #ffffff !important;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    cursor: pointer;
    flex: 0 0 auto;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.project-card-sendin-btn i { color: #ffffff !important; font-size: 0.9em; }
.project-card-sendin-btn:hover { background: #15803d; }
.project-card-sendin-btn.selected {
    background: #000000;
    border-color: #000000;
    color: #ffffff !important;
}
.project-card-sendin-btn.selected:hover { background: #262626; }
