/* =========================================================================
   CONSTRUCTIA - APPLICATION CORE DESIGN SYSTEM & STYLESHEET
   ========================================================================= */

:root {
    --brand-primary: #ED6056;        /* REDISH WALL (Official Brand Accent) */
    --brand-hover: #DB4F45;          /* Darker coral hover */
    --brand-glow: rgba(237, 96, 86, 0.28);
    --brand-dark: #2E3532;           /* DEEP MOSS (Official Corporate Dark) */
    --brand-cloud: #EEF7E1;          /* CLOUD (Official Light Tint) */
    --brand-moss-med: #47534E;
    --brand-moss-slate: #75857D;
    --bg-dark: #19201D;              /* Deep Moss dark background */
    --card-bg: rgba(36, 44, 41, 0.88);
    --card-border: rgba(72, 88, 82, 0.65);
    --canvas-bg: #121715;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: #f1f5f9;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* =========================================================================
   NAVBAR & HEADER
   ========================================================================= */
.nav-bar {
    border-bottom: 1px solid rgba(51, 65, 85, 0.6);
    background: rgba(9, 13, 22, 0.95);
    backdrop-filter: blur(12px);
    padding: 0.65rem 1.25rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.nav-container {
    max-width: 98rem;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.nav-brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.4));
    transition: transform 0.2s ease;
}

.brand-logo-img:hover {
    transform: scale(1.02);
}

.nav-brand-badge {
    background: rgba(237, 96, 86, 0.15);
    color: #ED6056;
    border: 1px solid rgba(237, 96, 86, 0.35);
    font-weight: 700;
}

.logo-box {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.6rem;
    background: linear-gradient(135deg, #ED6056, #DB4F45);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 10px var(--brand-glow);
}

.badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.45rem;
    border-radius: 0.375rem;
    background: rgba(237, 96, 86, 0.15);
    color: #ED6056;
    border: 1px solid rgba(237, 96, 86, 0.35);
    font-weight: 700;
}

/* Menu Tabs (Desktop) */
.nav-tabs {
    display: flex;
    background: rgba(15, 23, 42, 0.8);
    padding: 0.25rem;
    border-radius: 0.6rem;
    border: 1px solid #334155;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.nav-tab-btn {
    border: none;
    background: transparent;
    color: #94a3b8;
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 0.45rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-tab-btn:hover {
    color: #fff;
}

.nav-tab-btn.active {
    background: var(--brand-primary);
    color: #ffffff;
    box-shadow: 0 2px 10px var(--brand-glow);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.nav-link {
    font-size: 0.82rem;
    color: #cbd5e1;
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-radius: 0.5rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid #334155;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-link:hover {
    color: #ED6056;
    border-color: #ED6056;
}

/* Mobile Hamburger Button */
.mobile-menu-btn {
    display: none;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid #334155;
    color: #cbd5e1;
    padding: 0.45rem;
    border-radius: 0.5rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.mobile-menu-btn:hover,
.mobile-menu-btn:active {
    background: rgba(237, 96, 86, 0.2);
    border-color: #ED6056;
    color: #fff;
}

/* =========================================================================
   MOBILE NAVIGATION DRAWER (COLLAPSIBLE SIDEBAR MENU)
   ========================================================================= */
.mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-nav-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 86vw;
    max-width: 330px;
    background: #090d16;
    border-right: 1px solid rgba(72, 88, 82, 0.6);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 10px 0 35px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

.mobile-nav-drawer.open {
    transform: translateX(0);
}

.mobile-drawer-header {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.8);
}

.mobile-drawer-close {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid #334155;
    color: #cbd5e1;
    width: 2rem;
    height: 2rem;
    border-radius: 0.4rem;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.mobile-drawer-close:hover,
.mobile-drawer-close:active {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

.mobile-drawer-tabs {
    padding: 1rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
    flex-grow: 1;
}

.mobile-tab-btn {
    width: 100%;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(51, 65, 85, 0.4);
    color: #cbd5e1;
    padding: 0.8rem 1rem;
    border-radius: 0.65rem;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
    text-align: left;
}

.mobile-tab-btn svg {
    color: #94a3b8;
    flex-shrink: 0;
}

.mobile-tab-btn:hover,
.mobile-tab-btn:active {
    background: rgba(30, 41, 59, 0.9);
    color: #fff;
    border-color: rgba(237, 96, 86, 0.5);
}

.mobile-tab-btn.active {
    background: linear-gradient(135deg, #ED6056, #DB4F45);
    color: #ffffff;
    border-color: #ED6056;
    box-shadow: 0 4px 15px var(--brand-glow);
}

.mobile-tab-btn.active svg {
    color: #ffffff;
}

.mob-badge-pill {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 0.35rem;
}

.mobile-drawer-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(51, 65, 85, 0.6);
    background: rgba(15, 23, 42, 0.95);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-drawer-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(51, 65, 85, 0.4);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-drawer-link:hover,
.mobile-drawer-link:active {
    color: #fff;
    background: rgba(30, 41, 59, 0.9);
    border-color: #ED6056;
}

/* Tab Views */
.tab-view {
    display: none;
    flex-grow: 1;
    width: 100%;
}

.tab-view.active {
    display: flex;
    flex-direction: column;
}

/* =========================================================================
   CONVERTER (TAB 1)
   ========================================================================= */
.converter-main {
    max-width: 56rem;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-title {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    text-align: center;
    margin-bottom: 0.75rem;
    color: #fff;
}

.gradient-text {
    background: linear-gradient(to right, #ffffff, #ED6056, #EEF7E1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    text-align: center;
    color: #94a3b8;
    font-size: 0.95rem;
    max-width: 36rem;
    margin: 0 auto 2rem auto;
    line-height: 1.5;
}

.main-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 1.25rem;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.format-selector-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

.format-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.format-buttons {
    display: flex;
    gap: 0.5rem;
    background: rgba(15, 23, 42, 0.8);
    padding: 0.25rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(51, 65, 85, 0.6);
}

.btn-format {
    border: none;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-format.active {
    background: var(--brand-primary);
    color: #ffffff;
    box-shadow: 0 4px 8px -1px var(--brand-glow);
}

.btn-format.inactive {
    background: transparent;
    color: #94a3b8;
}

.btn-format.inactive:hover {
    color: #fff;
}

.dropzone {
    border: 2px dashed #475569;
    border-radius: 1rem;
    padding: 2.25rem 1.5rem;
    text-align: center;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.4);
    transition: all 0.25s;
}

.dropzone:hover,
.dropzone.drag-over {
    border-color: var(--brand-primary);
    background: rgba(15, 23, 42, 0.75);
}

.dropzone-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem auto;
    color: #ED6056;
    border: 1px solid #334155;
}

.file-info-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.9);
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid #334155;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
}

.btn-remove {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 0.375rem;
    transition: color 0.2s;
}

.btn-remove:hover {
    color: #f87171;
}

.btn-convert {
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.9rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 1rem;
    background: var(--brand-primary);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    box-shadow: 0 10px 15px -3px var(--brand-glow);
}

.btn-convert:hover:not(:disabled) {
    background: var(--brand-hover);
    transform: translateY(-1px);
}

.btn-convert:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.status-box {
    margin-top: 1.5rem;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid #334155;
    border-radius: 0.75rem;
    padding: 1.25rem;
}

.progress-bar-bg {
    width: 100%;
    background: #1e293b;
    border-radius: 9999px;
    height: 0.6rem;
    overflow: hidden;
    margin-top: 0.6rem;
}

.progress-bar-fill {
    background: linear-gradient(to right, #ED6056, #EEF7E1);
    height: 100%;
    border-radius: 9999px;
    transition: width 0.3s ease;
}

.result-box {
    margin-top: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.95);
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid #334155;
    gap: 0.75rem;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    border-radius: 0.6rem;
    font-weight: 700;
    font-size: 0.85rem;
    background: #10b981;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-download:hover {
    background: #34d399;
}

.btn-viewer-open {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    border-radius: 0.6rem;
    font-weight: 700;
    font-size: 0.85rem;
    background: #3b82f6;
    color: #eff6ff;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-viewer-open:hover {
    background: #60a5fa;
}

.btn-bim-open {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    border-radius: 0.6rem;
    font-weight: 700;
    font-size: 0.85rem;
    background: #8b5cf6;
    color: #f5f3ff;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-bim-open:hover {
    background: #a78bfa;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.feature-card {
    background: rgba(30, 41, 59, 0.35);
    border: 1px solid rgba(51, 65, 85, 0.4);
    border-radius: 0.75rem;
    padding: 1rem;
}

.feature-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    margin: 0.5rem 0 0.25rem 0;
}

.feature-desc {
    font-size: 0.775rem;
    color: #94a3b8;
    line-height: 1.4;
}

/* =========================================================================
   WORKSPACE SHARED (2D & 3D)
   ========================================================================= */
.viewer-workspace {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    height: calc(100vh - 65px);
    overflow: hidden;
}

.cad-toolbar {
    background: #0f172a;
    border-bottom: 1px solid #334155;
    padding: 0.4rem 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    justify-content: space-between;
}

.tool-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(30, 41, 59, 0.7);
    padding: 0.25rem;
    border-radius: 0.5rem;
    border: 1px solid #334155;
}

.tool-btn {
    background: transparent;
    border: none;
    color: #cbd5e1;
    padding: 0.35rem 0.6rem;
    border-radius: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.15s;
}

.tool-btn:hover {
    background: rgba(51, 65, 85, 0.8);
    color: #fff;
}

.tool-btn.active {
    background: var(--brand-primary);
    color: #ffffff;
}

.cad-main-area {
    display: flex;
    flex-grow: 1;
    position: relative;
    overflow: hidden;
}

.canvas-container {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    position: relative;
    background: var(--canvas-bg);
    cursor: crosshair;
    overflow: hidden;
}

#cadCanvas,
#bimCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* 3D Demo Banner */
.bim-demo-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 10;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid #8b5cf6;
    backdrop-filter: blur(10px);
    border-radius: 0.6rem;
    padding: 0.45rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #c4b5fd;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

/* Floating Mobile Sidebar Toggle Button on Canvas */
.cad-mob-sidebar-toggle {
    display: none;
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 20;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(237, 96, 86, 0.65);
    color: #ffffff;
    padding: 0.4rem 0.85rem;
    border-radius: 2rem;
    font-size: 0.76rem;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}

.cad-mob-sidebar-toggle:hover,
.cad-mob-sidebar-toggle:active {
    background: #ED6056;
    border-color: #ED6056;
    color: #ffffff;
    transform: scale(1.03);
}

@media (max-width: 900px) {
    .cad-mob-sidebar-toggle {
        display: flex;
        align-items: center;
        gap: 0.4rem;
    }
}

/* Sidebars */
.cad-sidebar {
    width: 22rem;
    min-width: 22rem;
    max-width: 100vw;
    flex-shrink: 0;
    background: #0b1120;
    border-left: 1px solid #334155;
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    overflow: hidden;
}

.cad-sidebar.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    border-left: none !important;
    overflow: hidden !important;
    padding: 0 !important;
}

.sidebar-header,
.sidebar-content {
    min-width: 22rem;
    box-sizing: border-box;
}

.sidebar-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #e2e8f0;
}

.sidebar-content {
    padding: 1rem;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.panel-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.layer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.5rem;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 0.4rem;
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
    border: 1px solid rgba(51, 65, 85, 0.3);
}

.layer-left {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.layer-color-picker {
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    border: 1px solid #64748b;
    cursor: pointer;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

.layer-color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.layer-color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
}

.layer-actions {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-layer-action {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.2rem 0.35rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
}

.btn-layer-action:hover {
    color: #ED6056;
    background: rgba(51, 65, 85, 0.8);
}

/* 3D Multi-Level Cards */
.level-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid #334155;
    border-radius: 0.6rem;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
    transition: border 0.2s;
}

.level-card.active-level {
    border-color: #8b5cf6;
}

.level-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.level-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    font-size: 0.75rem;
}

.level-input-box label {
    color: #94a3b8;
    font-size: 0.7rem;
    display: block;
    margin-bottom: 0.15rem;
}

.level-input-box input {
    width: 100%;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 0.3rem;
    color: #fff;
    padding: 0.25rem 0.4rem;
    font-size: 0.75rem;
}

.measurement-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid #334155;
    border-radius: 0.5rem;
    padding: 0.6rem;
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: all 0.2s;
}

.measurement-card:hover {
    border-color: #38bdf8;
    background: rgba(30, 41, 59, 0.85);
}

/* Scale & Calibration Section */
.scale-badge {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    padding: 0.15rem 0.5rem;
    border-radius: 0.4rem;
    font-size: 0.7rem;
    font-weight: 700;
    font-family: monospace;
}

.scale-control-box {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid #334155;
    border-radius: 0.5rem;
    padding: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cad-select-input {
    width: 100%;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 0.35rem;
    color: #e2e8f0;
    padding: 0.35rem 0.5rem;
    font-size: 0.78rem;
    outline: none;
    box-sizing: border-box;
}

.cad-select-input:focus {
    border-color: #38bdf8;
}

.cad-num-input {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 0.35rem;
    color: #fff;
    padding: 0.35rem 0.5rem;
    font-size: 0.78rem;
    font-family: monospace;
    width: 6rem;
    box-sizing: border-box;
}

.cad-num-input:focus {
    border-color: #38bdf8;
}

.btn-calibrate-tool {
    width: 100%;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(99, 102, 241, 0.15));
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    padding: 0.45rem 0.65rem;
    border-radius: 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.2s;
}

.btn-calibrate-tool:hover {
    background: rgba(56, 189, 248, 0.25);
    border-color: #38bdf8;
    color: #fff;
}

.btn-calibrate-tool.calibrating {
    background: #eab308;
    color: #0f172a;
    border-color: #ca8a04;
    animation: pulseCalibrate 1.5s infinite;
}

@keyframes pulseCalibrate {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(0.99); }
}

.calibration-guide-box {
    background: rgba(234, 179, 8, 0.12);
    border: 1px solid rgba(234, 179, 8, 0.35);
    color: #fde047;
    font-size: 0.72rem;
    padding: 0.4rem 0.6rem;
    border-radius: 0.35rem;
    line-height: 1.35;
}

/* Area & Measurement Summary Styling */
.area-summary-box {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid #334155;
    border-radius: 0.5rem;
    padding: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.area-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: #cbd5e1;
}

.area-summary-val {
    font-family: monospace;
    font-weight: 700;
    color: #4ade80;
    font-size: 0.88rem;
}

.btn-quote-export {
    width: 100%;
    background: linear-gradient(135deg, #059669, #10b981);
    color: #ffffff;
    border: none;
    padding: 0.5rem 0.65rem;
    border-radius: 0.4rem;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
    transition: all 0.2s;
    margin-top: 0.25rem;
}

.btn-quote-export:hover {
    background: linear-gradient(135deg, #047857, #059669);
    box-shadow: 0 6px 14px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

/* Floating Contextual Banner & Calibration Modal in CAD Viewer */
.cad-floating-banner {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(56, 189, 248, 0.4);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    border-radius: 9999px;
    padding: 0.45rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.78rem;
    color: #e2e8f0;
    max-width: 90%;
    animation: fadeInDownBanner 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInDownBanner {
    from { opacity: 0; transform: translate(-50%, -10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.cad-banner-btn {
    border: none;
    border-radius: 9999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.15s ease;
}

.cad-banner-btn-success {
    background: #10b981;
    color: #ffffff;
}

.cad-banner-btn-success:hover {
    background: #059669;
}

.cad-banner-btn-cancel {
    background: rgba(51, 65, 85, 0.8);
    color: #cbd5e1;
}

.cad-banner-btn-cancel:hover {
    background: rgba(239, 68, 68, 0.8);
    color: #ffffff;
}

.cad-calibration-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 25;
    width: 22rem;
    max-width: calc(100% - 2rem);
    background: #0f172a;
    border: 1px solid rgba(56, 189, 248, 0.5);
    border-radius: 0.75rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    animation: zoomInModal 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zoomInModal {
    from { opacity: 0; transform: translate(-50%, -46%) scale(0.96); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.cad-modal-header {
    padding: 0.75rem 1rem;
    background: #1e293b;
    border-bottom: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cad-modal-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0;
}

.cad-modal-close:hover {
    color: #f87171;
}

.cad-modal-body {
    padding: 1rem;
}

.cad-modal-num-input {
    flex: 1;
    background: #090d16;
    border: 1.5px solid #38bdf8;
    color: #38bdf8;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: monospace;
    border-radius: 0.4rem;
    padding: 0.4rem 0.6rem;
    outline: none;
}

.cad-modal-num-input:focus {
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35);
}

.cad-modal-footer {
    padding: 0.65rem 1rem;
    background: #1e293b;
    border-top: 1px solid #334155;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.btn-cad-modal-secondary {
    background: transparent;
    border: 1px solid #475569;
    color: #cbd5e1;
    border-radius: 0.35rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-cad-modal-secondary:hover {
    background: #334155;
    color: #fff;
}

.btn-cad-modal-primary {
    background: #0284c7;
    border: 1px solid #38bdf8;
    color: #ffffff;
    border-radius: 0.35rem;
    padding: 0.35rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

.btn-cad-modal-primary:hover {
    background: #0369a1;
}

/* Bottom HUD */
.cad-hud {
    background: #090d16;
    border-top: 1px solid #1e293b;
    padding: 0.35rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #94a3b8;
    font-family: monospace;
}

.hud-coords {
    color: #ED6056;
    font-weight: 600;
}

.color-picker-dot {
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
}

.color-picker-dot.selected {
    border-color: #fff;
    transform: scale(1.15);
}

.theme-select {
    background: #1e293b;
    color: #cbd5e1;
    border: 1px solid #334155;
    border-radius: 0.35rem;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
}

/* =========================================================================
   ESTIMATOR & COTIZADOR (TAB 4)
   ========================================================================= */
.estimator-workspace {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    height: calc(100vh - 65px);
    overflow-y: auto;
    background: var(--bg-dark);
}

.estimator-header-bar {
    background: #0f172a;
    border-bottom: 1px solid #334155;
    padding: 0.75rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(10px);
}

.estimator-content {
    max-width: 96rem;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.estimator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(28rem, 1fr));
    gap: 1.25rem;
}

.calc-card {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(51, 65, 85, 0.8);
    border-radius: 0.85rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
}

.calc-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(51, 65, 85, 0.6);
    padding-bottom: 0.65rem;
}

.calc-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.calc-card-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 0.35rem;
    background: rgba(237, 96, 86, 0.15);
    color: #ED6056;
    border: 1px solid rgba(237, 96, 86, 0.35);
}

.calc-inputs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.75rem;
}

.calc-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.calc-label {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
}

.calc-input {
    background: #0b1120;
    border: 1px solid #334155;
    border-radius: 0.45rem;
    color: #fff;
    padding: 0.45rem 0.65rem;
    font-size: 0.85rem;
    font-weight: 600;
    transition: border-color 0.2s;
}

.calc-input:focus {
    outline: none;
    border-color: var(--brand-primary);
}

.calc-select {
    background: #0b1120;
    border: 1px solid #334155;
    border-radius: 0.45rem;
    color: #fff;
    padding: 0.45rem 0.65rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.calc-results-panel {
    background: rgba(30, 41, 59, 0.45);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 0.65rem;
    padding: 0.85rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 0.6rem;
}

.calc-result-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.calc-result-label {
    font-size: 0.68rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.calc-result-val {
    font-size: 1.05rem;
    font-weight: 800;
    color: #38bdf8;
    font-family: monospace;
}

.calc-result-sub {
    font-size: 0.68rem;
    color: #64748b;
}

/* Tables */
.items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.items-table th {
    background: rgba(30, 41, 59, 0.8);
    color: #cbd5e1;
    text-align: left;
    padding: 0.5rem 0.6rem;
    font-weight: 600;
    border-bottom: 1px solid #334155;
}

.items-table td {
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.4);
    color: #e2e8f0;
}

.items-table tr:hover {
    background: rgba(30, 41, 59, 0.3);
}

.btn-table-del {
    background: transparent;
    border: none;
    color: #f87171;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
}

.btn-table-del:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Summary Banner */
.summary-banner {
    background: linear-gradient(135deg, rgba(46, 53, 50, 0.95), rgba(25, 32, 29, 0.92));
    border: 1px solid rgba(237, 96, 86, 0.45);
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.summary-metric-box {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.summary-grand-total {
    font-size: 1.85rem;
    font-weight: 900;
    color: #ED6056;
    font-family: monospace;
    letter-spacing: -0.02em;
}

/* =========================================================================
   MODAL SYSTEM
   ========================================================================= */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(8px);
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
}

.modal-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85), 0 0 25px rgba(237, 96, 86, 0.2);
    width: 100%;
    max-width: 52rem;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.25s ease;
}

.modal-backdrop.show .modal-card {
    transform: scale(1);
}

.modal-card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.95);
}

.modal-card-body {
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.modal-card-footer {
    padding: 0.85rem 1.5rem;
    border-top: 1px solid #334155;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: rgba(15, 23, 42, 0.95);
}

/* =========================================================================
   CLIENT CRM DIRECTORY
   ========================================================================= */
.client-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr));
    gap: 1rem;
}

.client-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.75rem;
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.85rem;
    transition: all 0.2s ease;
}

.client-card:hover {
    border-color: #ED6056;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.5), 0 0 15px rgba(237, 96, 86, 0.15);
}

.client-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.client-card-name {
    font-size: 0.98rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
}

.client-badge {
    background: rgba(237, 96, 86, 0.15);
    color: #ED6056;
    border: 1px solid rgba(237, 96, 86, 0.35);
    font-size: 0.7rem;
    font-family: monospace;
    padding: 0.15rem 0.45rem;
    border-radius: 0.35rem;
    white-space: nowrap;
}

.client-card-body {
    font-size: 0.78rem;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.client-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(51, 65, 85, 0.6);
    padding-top: 0.75rem;
    gap: 0.5rem;
}

.client-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.client-search-wrapper svg {
    position: absolute;
    left: 0.85rem;
    color: #94a3b8;
    pointer-events: none;
}

.client-search-input {
    width: 100%;
    background: #0f172a;
    border: 1px solid #334155;
    color: #fff;
    border-radius: 0.5rem;
    padding: 0.55rem 0.85rem 0.55rem 2.4rem;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.client-search-input:focus {
    border-color: #ED6056;
    box-shadow: 0 0 0 2px rgba(237, 96, 86, 0.2);
}

/* =========================================================================
   VERSION TRACKING & NOTIFICATIONS
   ========================================================================= */
.version-corner-badge {
    position: fixed;
    bottom: 0.85rem;
    right: 0.85rem;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(51, 65, 85, 0.8);
    backdrop-filter: blur(12px);
    padding: 0.3rem 0.65rem;
    border-radius: 2rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 0 10px rgba(237, 96, 86, 0.15);
    font-size: 0.72rem;
    color: #94a3b8;
    cursor: pointer;
    user-select: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.version-corner-badge:hover {
    border-color: #ED6056;
    color: #f1f5f9;
    transform: translateY(-2px);
    box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.8), 0 0 15px rgba(237, 96, 86, 0.25);
}

.version-corner-badge.has-update {
    border-color: #f59e0b;
    background: rgba(30, 27, 75, 0.95);
    color: #fef3c7;
    animation: pulse-border 2s infinite;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.35);
}

@keyframes pulse-border {
    0%, 100% { border-color: #f59e0b; box-shadow: 0 0 10px rgba(245, 158, 11, 0.3); }
    50% { border-color: #ef4444; box-shadow: 0 0 20px rgba(239, 68, 68, 0.5); }
}

.version-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    display: inline-block;
}

.version-dot.has-update {
    background: #f59e0b;
    box-shadow: 0 0 10px #f59e0b;
    animation: blink 1s infinite alternate;
}

@keyframes blink {
    from { opacity: 0.3; }
    to { opacity: 1; }
}

.corner-update-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #451a03;
    border: none;
    padding: 0.15rem 0.45rem;
    border-radius: 1rem;
    font-weight: 700;
    font-size: 0.68rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.15s;
}

.corner-update-btn:hover {
    background: #fbbf24;
    transform: scale(1.05);
}

.version-popover {
    position: fixed;
    bottom: 3.2rem;
    right: 0.85rem;
    z-index: 10000;
    width: 19.5rem;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(51, 65, 85, 0.9);
    border-radius: 0.85rem;
    padding: 1rem;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(16px);
    display: none;
    flex-direction: column;
    gap: 0.65rem;
}

.version-popover.show {
    display: flex;
    animation: slide-up 0.2s ease-out;
}

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

.update-toast-banner {
    position: fixed;
    top: 1.25rem;
    left: 50%;
    transform: translateX(-50%) translateY(-150%);
    z-index: 10001;
    width: 92%;
    max-width: 32rem;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.97), rgba(30, 27, 75, 0.97));
    border: 1px solid #8b5cf6;
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.8), 0 0 25px rgba(139, 92, 246, 0.35);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
    opacity: 0;
    pointer-events: none;
}

.update-toast-banner.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* =========================================================================
   MODERN TOAST NOTIFICATIONS (NEW)
   ========================================================================= */
.toast-container {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 10080;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 24rem;
    width: 90%;
    pointer-events: none;
}

.toast-item {
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.94);
    border: 1px solid #334155;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 0 15px rgba(237, 96, 86, 0.15);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    animation: toast-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.25s ease;
}

.toast-item.hide {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-12px) scale(0.92); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast-icon {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.toast-content {
    flex-grow: 1;
}

.toast-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.15rem;
}

.toast-msg {
    font-size: 0.78rem;
    color: #cbd5e1;
    line-height: 1.4;
}

.toast-item.toast-success { border-color: #10b981; }
.toast-item.toast-success .toast-title { color: #34d399; }

.toast-item.toast-error { border-color: #ef4444; }
.toast-item.toast-error .toast-title { color: #f87171; }

.toast-item.toast-warning { border-color: #f59e0b; }
.toast-item.toast-warning .toast-title { color: #fbbf24; }

.toast-item.toast-info { border-color: #38bdf8; }
.toast-item.toast-info .toast-title { color: #7dd3fc; }

/* Utilities */
.hidden {
    display: none !important;
}

.spin {
    animation: spin 1s linear infinite;
}

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

/* =========================================================================
   CONSTRUCTIA - PRODUCT CATALOG & 3D MATERIAL ENGINE STYLES
   ========================================================================= */

.catalog-workspace {
    max-width: 1440px;
    margin: 0 auto;
    padding: 1.5rem 2rem 4rem 2rem;
}

/* Hero Showcase Banner */
.catalog-hero {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.85)),
                radial-gradient(circle at top right, rgba(237, 96, 86, 0.15), transparent 50%);
    border: 1px solid rgba(237, 96, 86, 0.3);
    border-radius: 1rem;
    padding: 2rem 2.5rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.catalog-hero-title {
    font-size: 1.85rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.25;
    margin-bottom: 0.6rem;
    letter-spacing: -0.02em;
}

.catalog-hero-desc {
    font-size: 0.9rem;
    color: #cbd5e1;
    max-width: 680px;
    line-height: 1.6;
}

.catalog-hero-stats {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

.hero-stat-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    text-align: center;
    min-width: 120px;
    backdrop-filter: blur(8px);
}

.hero-stat-card .stat-num {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ED6056;
    margin-bottom: 0.2rem;
}

.hero-stat-card .stat-label {
    font-size: 0.7rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Filter & Search Bar */
.catalog-filter-bar {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid #334155;
    border-radius: 0.85rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    backdrop-filter: blur(12px);
}

.catalog-search-wrap {
    position: relative;
    width: 100%;
}

.catalog-search-wrap .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.catalog-search-input {
    width: 100%;
    background: #0b1120;
    border: 1px solid #334155;
    border-radius: 0.6rem;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    color: #fff;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
}

.catalog-search-input:focus {
    border-color: #ED6056;
    box-shadow: 0 0 0 3px rgba(237, 96, 86, 0.2);
}

.catalog-category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cat-pill {
    background: #1e293b;
    border: 1px solid #334155;
    color: #cbd5e1;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.45rem 0.9rem;
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cat-pill:hover {
    background: #334155;
    color: #fff;
    border-color: #64748b;
}

.cat-pill.active {
    background: linear-gradient(135deg, #ED6056, #DB4F45);
    border-color: #ED6056;
    color: #fff;
    box-shadow: 0 4px 12px rgba(237, 96, 86, 0.35);
}

.catalog-target-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(51, 65, 85, 0.6);
}

.target-pill {
    background: transparent;
    border: 1px solid #334155;
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 0.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.target-pill:hover {
    color: #cbd5e1;
    border-color: #64748b;
}

.target-pill.active {
    background: rgba(124, 58, 237, 0.2);
    border-color: #a78bfa;
    color: #c4b5fd;
}

/* Results Header */
.catalog-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding: 0 0.25rem;
}

/* Products Grid */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 1.5rem;
}

/* Product Card */
.product-card {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 0.85rem;
    overflow: visible;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: rgba(45, 212, 191, 0.5);
    box-shadow: 0 12px 28px -5px rgba(0, 0, 0, 0.5), 0 0 20px rgba(45, 212, 191, 0.12);
    z-index: 20;
}

.product-card:has(.dropdown-menu-3d:not(.hidden)) {
    z-index: 50;
}

.product-image-wrap {
    position: relative;
    width: 100%;
    height: 190px;
    background: #020617;
    overflow: hidden;
    border-top-left-radius: 0.85rem;
    border-top-right-radius: 0.85rem;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-img {
    transform: scale(1.05);
}

.product-badge-category {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ED6056;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.25rem 0.55rem;
    border-radius: 2rem;
    letter-spacing: 0.03em;
}

.product-color-indicator {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.product-body {
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-series {
    font-size: 0.7rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.product-title {
    font-size: 1.02rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 0.6rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-specs-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.spec-chip {
    background: #1e293b;
    border: 1px solid rgba(51, 65, 85, 0.8);
    font-size: 0.68rem;
    color: #cbd5e1;
    padding: 0.15rem 0.45rem;
    border-radius: 0.35rem;
}

.product-desc {
    font-size: 0.78rem;
    color: #94a3b8;
    line-height: 1.45;
    margin-bottom: 1rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price-row {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid #334155;
    border-radius: 0.5rem;
    padding: 0.6rem 0.85rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-val {
    font-size: 1.25rem;
    font-weight: 800;
    color: #34d399;
    font-family: monospace;
}

.price-unit {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-left: 0.2rem;
}

/* Actions in Card */
.product-actions-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.apply-3d-dropdown {
    position: relative;
    width: 100%;
}

.btn-apply-3d {
    width: 100%;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    border: 1px solid #8b5cf6;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.55rem 0.85rem;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(109, 40, 217, 0.25);
}

.btn-apply-3d:hover {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    box-shadow: 0 6px 16px rgba(109, 40, 217, 0.4);
    transform: translateY(-1px);
}

.dropdown-menu-3d {
    position: absolute;
    bottom: 105%;
    left: 0;
    right: 0;
    background: #0f172a;
    border: 1px solid #475569;
    border-radius: 0.6rem;
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
    z-index: 100;
    animation: fadeInSlideUp 0.15s ease-out;
}

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

.dropdown-header {
    font-size: 0.68rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 700;
    padding: 0.35rem 0.6rem 0.2rem 0.6rem;
}

.dropdown-item {
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-size: 0.78rem;
    padding: 0.45rem 0.65rem;
    border-radius: 0.35rem;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    transition: background 0.15s ease;
}

.dropdown-item:hover {
    background: #1e293b;
    color: #ED6056;
}

.btn-card-secondary {
    flex: 1;
    background: #1e293b;
    border: 1px solid #334155;
    color: #cbd5e1;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.45rem 0.6rem;
    border-radius: 0.45rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-card-secondary:hover {
    background: #334155;
    color: #fff;
    border-color: #64748b;
}

.btn-card-secondary.btn-quote:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
    color: #34d399;
}

/* Toast Jump to 3D Banner */
.toast-jump-3d {
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    border: 1px solid #6366f1;
    border-radius: 0.65rem;
    padding: 0.65rem 1rem;
    color: #e0e7ff;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    animation: toastSlideIn 0.25s ease-out;
}

.btn-jump {
    background: #4f46e5;
    border: none;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border-radius: 0.35rem;
    cursor: pointer;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.btn-jump:hover {
    background: #6366f1;
}

/* =========================================================================
   FLOATING MATERIAL HUD ON 3D CANVAS
   ========================================================================= */

.bim-materials-floating-hud {
    position: absolute;
    bottom: 1.25rem;
    left: 1.25rem;
    background: rgba(25, 32, 29, 0.94);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(72, 88, 82, 0.85);
    border-radius: 0.85rem;
    padding: 0.75rem 0.95rem;
    width: 285px;
    z-index: 25;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(237, 96, 86, 0.15);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: auto;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.bim-materials-floating-hud.minimized {
    width: auto;
    padding: 0.4rem 0.75rem;
    background: rgba(36, 44, 41, 0.94);
    border-color: rgba(237, 96, 86, 0.5);
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.bim-materials-floating-hud.minimized .hud-mat-body,
.bim-materials-floating-hud.minimized .hud-mat-quote-btn {
    display: none;
}

.bim-materials-floating-hud.minimized .hud-mat-header {
    border-bottom: none;
    padding-bottom: 0;
    gap: 0.5rem;
}

.hud-mat-minimize-btn {
    background: rgba(51, 65, 85, 0.5);
    border: 1px solid rgba(72, 88, 82, 0.7);
    color: #cbd5e1;
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: all 0.15s ease;
}

.hud-mat-minimize-btn:hover {
    background: #ED6056;
    color: #fff;
    border-color: #ED6056;
}

.hud-mat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(72, 88, 82, 0.7);
}

.hud-mat-btn-catalog {
    background: transparent;
    border: none;
    color: #ED6056;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s ease;
}

.hud-mat-btn-catalog:hover {
    color: #fca5a5;
    text-decoration: underline;
}

.hud-mat-body {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.hud-mat-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.72rem;
    background: rgba(36, 44, 41, 0.6);
    padding: 0.35rem 0.5rem;
    border-radius: 0.4rem;
    border: 1px solid rgba(72, 88, 82, 0.5);
}

.hud-mat-label {
    color: #94a3b8;
    font-weight: 600;
    white-space: nowrap;
}

.hud-mat-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

.hud-mat-name {
    color: #fff;
    font-weight: 500;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hud-mat-metric {
    color: #ED6056;
    font-family: monospace;
    font-weight: 700;
    font-size: 0.7rem;
    white-space: nowrap;
}

.hud-mat-quote-btn {
    width: 100%;
    background: linear-gradient(135deg, #ED6056, #DB4F45);
    border: 1px solid rgba(237, 96, 86, 0.5);
    color: #fff;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 0.45rem;
    border-radius: 0.45rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(237, 96, 86, 0.25);
    margin-top: 0.2rem;
}

.hud-mat-quote-btn:hover {
    background: linear-gradient(135deg, #DB4F45, #ED6056);
}

/* =========================================================================
   MOBILE DRAWER NAVIGATION & RESPONSIVE MENU
   ========================================================================= */
.mobile-menu-btn {
    display: none;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid #334155;
    color: #f1f5f9;
    padding: 0.35rem 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.mobile-menu-btn:hover,
.mobile-menu-btn:active {
    background: #ED6056;
    border-color: #ED6056;
    color: #ffffff;
}

.mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.mobile-nav-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 290px;
    max-width: 85vw;
    background: #090d16;
    border-right: 1px solid #334155;
    z-index: 999;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 10px 0 35px rgba(0, 0, 0, 0.85);
    overflow-y: auto;
}

.mobile-nav-drawer.open {
    transform: translateX(0);
}

.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.6);
    background: rgba(15, 23, 42, 0.95);
}

.mobile-drawer-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.2rem 0.5rem;
    border-radius: 0.35rem;
    transition: all 0.15s ease;
}

.mobile-drawer-close:hover {
    color: #fff;
    background: rgba(239, 68, 68, 0.2);
}

.mobile-drawer-tabs {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.85rem 0.75rem;
    flex-grow: 1;
}

.mobile-tab-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid transparent;
    background: transparent;
    color: #cbd5e1;
    font-size: 0.86rem;
    font-weight: 600;
    border-radius: 0.55rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    width: 100%;
}

.mobile-tab-btn:hover {
    background: rgba(30, 41, 59, 0.8);
    color: #fff;
}

.mobile-tab-btn.active {
    background: #ED6056;
    color: #ffffff;
    border-color: #ED6056;
    box-shadow: 0 4px 12px rgba(237, 96, 86, 0.3);
}

.mob-badge-pill {
    margin-left: auto;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 0.15rem 0.45rem;
    border-radius: 1rem;
    letter-spacing: 0.04em;
}

.mobile-drawer-footer {
    padding: 0.85rem;
    border-top: 1px solid rgba(51, 65, 85, 0.6);
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.mobile-drawer-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.76rem;
    padding: 0.4rem 0.6rem;
    border-radius: 0.4rem;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}

.mobile-drawer-link:hover {
    background: rgba(30, 41, 59, 0.8);
    color: #fff;
}

/* =========================================================================
   COMPREHENSIVE RESPONSIVE DESIGN SYSTEM & MEDIA QUERIES
   ========================================================================= */

/* 1. TABLET & SMALL LAPTOPS (<= 1024px) */
@media (max-width: 1024px) {
    .nav-container {
        padding: 0 0.5rem;
    }
    .catalog-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }
    .estimator-workspace {
        padding: 1.25rem 1rem;
    }
    .formal-doc-wrapper {
        padding: 1.5rem;
    }
}

/* 2. TABLET PORTRAIT & MOBILE BREAKPOINT (<= 900px) */
@media (max-width: 900px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-menu-btn {
        display: flex !important;
    }

    .nav-bar {
        padding: 0.25rem 0.65rem;
        height: 42px;
        min-height: 42px;
    }

    .brand-logo-img {
        height: 24px;
    }

    .nav-brand-badge {
        font-size: 0.6rem;
        padding: 0.1rem 0.3rem;
    }

    /* Workspace Full Height Adjustment - Maximum Viewport for 2D/3D */
    .viewer-workspace {
        height: calc(100vh - 42px) !important;
    }

    .cad-mob-sidebar-toggle {
        display: flex !important;
    }

    /* 2D & 3D Sidebars Mobile Slide-Over Drawer Mode */
    .cad-sidebar {
        position: absolute !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 88vw !important;
        min-width: 0 !important;
        max-width: 360px !important;
        height: 100% !important;
        z-index: 45 !important;
        box-shadow: -10px 0 35px rgba(0, 0, 0, 0.85) !important;
        transform: translateX(0) !important;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease !important;
        background: #090d16 !important;
    }

    .cad-sidebar.collapsed {
        transform: translateX(100%) !important;
        width: 88vw !important;
        min-width: 0 !important;
        max-width: 360px !important;
        display: flex !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    .sidebar-header,
    .sidebar-content {
        min-width: 0 !important;
        width: 100% !important;
    }

    /* Catalog Hero */
    .catalog-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.25rem 1rem;
        gap: 1rem;
    }

    .catalog-hero-stats {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .hero-stat-card {
        flex: 1;
        padding: 0.6rem 0.4rem;
        text-align: center;
    }

    .bim-materials-floating-hud {
        width: calc(100% - 1.5rem);
        max-width: 320px;
        left: 0.75rem;
        bottom: 0.75rem;
    }
}

/* 3. MOBILE PHONES (<= 768px) */
@media (max-width: 768px) {
    /* General Typography & Spacing */
    body {
        font-size: 14px;
    }

    /* TAB 1: CONVERTER */
    .converter-main {
        padding: 1.25rem 0.85rem;
    }

    .hero-title {
        font-size: 1.55rem;
        line-height: 1.25;
        margin-bottom: 0.5rem;
    }

    .hero-desc {
        font-size: 0.85rem;
        margin-bottom: 1.25rem;
        line-height: 1.45;
    }

    .main-card {
        padding: 1.25rem 0.9rem;
        border-radius: 1rem;
    }

    .format-selector-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.65rem;
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }

    .format-buttons {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .btn-format {
        text-align: center;
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    .dropzone {
        padding: 1.5rem 0.75rem;
    }

    .dropzone-icon {
        width: 3rem;
        height: 3rem;
        margin-bottom: 0.75rem;
    }

    .btn-convert {
        padding: 0.85rem;
        font-size: 0.95rem;
        border-radius: 0.65rem;
    }

    .result-box {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .result-box > div {
        width: 100%;
    }

    .btn-download,
    .btn-viewer-open,
    .btn-bim-open {
        width: 100%;
        justify-content: center;
        padding: 0.65rem;
        font-size: 0.85rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        margin-top: 1.25rem;
    }

    /* TAB 2 & 3: CAD & BIM WORKSPACES */
    .cad-toolbar {
        padding: 0.35rem 0.5rem;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0.35rem;
        justify-content: flex-start;
    }

    .cad-toolbar::-webkit-scrollbar {
        display: none;
    }

    .tool-group {
        flex-shrink: 0;
        padding: 0.2rem;
        gap: 0.2rem;
    }

    .tool-btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.75rem;
        min-height: 34px;
        white-space: nowrap;
    }

    .cad-hud {
        position: absolute;
        bottom: 0.4rem;
        left: 0.4rem;
        z-index: 15;
        background: rgba(15, 23, 42, 0.85);
        backdrop-filter: blur(8px);
        border: 1px solid rgba(51, 65, 85, 0.5);
        border-radius: 0.5rem;
        padding: 0.25rem 0.5rem;
        font-size: 0.68rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.15rem;
        max-width: calc(100% - 0.8rem);
        pointer-events: none;
    }

    .cad-hud > div {
        display: flex;
        gap: 0.5rem !important;
        flex-wrap: wrap;
    }

    .cad-floating-banner {
        width: calc(100% - 1.5rem);
        max-width: 100%;
        border-radius: 0.65rem;
        padding: 0.45rem 0.75rem;
        font-size: 0.72rem;
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        top: 0.5rem;
    }

    .cad-calibration-modal {
        width: calc(100% - 1.5rem);
        max-width: 340px;
    }

    /* TAB 4: CATALOG */
    .catalog-workspace {
        padding: 1rem 0.75rem;
    }

    .catalog-hero-title {
        font-size: 1.3rem;
        line-height: 1.25;
    }

    .catalog-hero-desc {
        font-size: 0.8rem;
    }

    .stat-num {
        font-size: 0.92rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .catalog-filter-bar {
        padding: 0.75rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
    }

    .catalog-search-wrap {
        width: 100%;
    }

    .catalog-category-pills,
    .catalog-target-filter {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 0.25rem;
        width: 100%;
    }

    .catalog-category-pills::-webkit-scrollbar,
    .catalog-target-filter::-webkit-scrollbar {
        display: none;
    }

    .cat-pill,
    .target-pill {
        flex-shrink: 0;
        font-size: 0.75rem;
        padding: 0.35rem 0.65rem;
        white-space: nowrap;
    }

    .catalog-results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

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

    .catalog-card-body {
        padding: 0.85rem;
    }

    .catalog-card-footer {
        flex-direction: column;
        gap: 0.4rem;
        align-items: stretch;
    }

    .catalog-card-footer .tool-btn {
        width: 100%;
        justify-content: center;
    }

    /* TAB 5: ESTIMATOR & COTIZADOR RESPONSIVE */
    #tabEstimator {
        height: auto !important;
        min-height: calc(100vh - 42px) !important;
        display: flex;
        flex-direction: column;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    .estimator-workspace {
        height: auto !important;
        min-height: calc(100vh - 42px) !important;
        overflow-y: visible !important;
        overflow-x: hidden !important;
        padding: 0.65rem 0.5rem !important;
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
        -webkit-overflow-scrolling: touch;
    }

    .estimator-header-bar {
        position: relative !important;
        top: auto !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.65rem !important;
        padding: 0.75rem 0.65rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
        border-radius: 0.65rem;
    }

    .estimator-header-bar > div:first-child {
        gap: 0.5rem !important;
    }

    .estimator-header-bar > div:first-child h2 {
        font-size: 0.95rem !important;
    }

    .estimator-header-bar > div:first-child p {
        font-size: 0.7rem !important;
    }

    .estimator-header-bar > div:last-child {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.35rem !important;
        width: 100% !important;
    }

    .estimator-header-bar .tool-btn {
        width: 100% !important;
        justify-content: center !important;
        padding: 0.45rem 0.5rem !important;
        font-size: 0.74rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .estimator-content {
        padding: 0.5rem 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        gap: 0.85rem !important;
    }

    /* Summary Banner Mobile */
    .summary-banner {
        padding: 0.85rem 0.65rem !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
        border-radius: 0.75rem !important;
    }

    .summary-banner > div:first-child {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }

    .summary-banner > div:first-child > .summary-metric-box:first-child {
        grid-column: 1 / -1 !important;
        background: rgba(15, 23, 42, 0.6);
        padding: 0.6rem 0.75rem;
        border-radius: 0.5rem;
        border: 1px solid rgba(237, 96, 86, 0.3);
    }

    .summary-banner > div:first-child > div[style*="width: 1px"] {
        display: none !important;
    }

    .summary-grand-total {
        font-size: 1.45rem !important;
    }

    .summary-metric-box {
        gap: 0.15rem !important;
    }

    .summary-metric-box strong {
        font-size: 0.9rem !important;
    }

    .summary-banner > div:last-child {
        width: 100% !important;
        justify-content: space-between !important;
        box-sizing: border-box !important;
    }

    /* Estimator Calculators Grid */
    .estimator-grid {
        grid-template-columns: 1fr !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        gap: 0.85rem !important;
    }

    .calc-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding: 0.85rem 0.65rem !important;
        box-sizing: border-box !important;
        border-radius: 0.75rem !important;
    }

    .calc-card-title {
        font-size: 0.86rem !important;
    }

    .calc-inputs-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .calc-input,
    .calc-select {
        font-size: 0.8rem !important;
        padding: 0.4rem 0.5rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .calc-results-panel {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.4rem !important;
        padding: 0.6rem 0.5rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
        min-width: 0 !important;
    }

    .calc-result-item {
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .calc-result-label {
        font-size: 0.64rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .calc-result-val {
        font-size: 0.88rem !important;
    }

    .calc-result-sub {
        font-size: 0.62rem !important;
    }

    /* Table Wrappers in Estimator */
    .items-table {
        min-width: 480px !important;
        font-size: 0.72rem !important;
    }

    .items-table th,
    .items-table td {
        padding: 0.4rem 0.45rem !important;
    }

    /* Action Proposal Bottom Card */
    .estimator-content > div[style*="margin-top: 1.5rem"] {
        padding: 0.85rem 0.65rem !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .estimator-content > div[style*="margin-top: 1.5rem"] > div:last-child {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.4rem !important;
        width: 100% !important;
    }

    .estimator-content > div[style*="margin-top: 1.5rem"] .tool-btn {
        width: 100% !important;
        justify-content: center !important;
        padding: 0.45rem 0.5rem !important;
        font-size: 0.74rem !important;
    }

    /* Metric Cards Grid */
    .summary-grid,
    .estimator-kpi-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .kpi-card {
        padding: 0.65rem;
    }

    .kpi-val {
        font-size: 1.15rem;
    }

    /* Form Grids Stacking */
    .estimator-form-grid,
    .calc-grid,
    .create-user-grid {
        display: grid;
        grid-template-columns: 1fr !important;
        gap: 0.65rem;
    }

    /* Responsive Tables */
    .table-responsive,
    .estimator-table-wrap {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 0.5rem;
    }

    .terminal-table,
    .estimator-table {
        min-width: 480px;
    }

    /* MODALS & DIALOGS */
    .modal-backdrop {
        padding: 0.25rem !important;
        align-items: flex-end !important;
    }

    .modal-card {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 94vh !important;
        border-radius: 1rem 1rem 0 0 !important;
        margin: 0 !important;
    }

    .modal-card-header {
        padding: 0.75rem 0.9rem;
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .modal-card-body {
        padding: 0.85rem 0.75rem;
        max-height: calc(94vh - 110px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .modal-card-footer {
        padding: 0.75rem 0.9rem;
        flex-direction: column;
        gap: 0.4rem;
    }

    .modal-card-footer button,
    .modal-card-footer .tool-btn {
        width: 100%;
        justify-content: center;
    }

    .client-cards-grid {
        grid-template-columns: 1fr !important;
        gap: 0.65rem !important;
    }

    .formal-doc-wrapper {
        padding: 1rem 0.75rem;
        font-size: 12px;
    }

    /* Toast Notification Mobile Positioning */
    .toast-container {
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
        max-width: 100%;
    }

    .toast-item {
        max-width: 100%;
    }
}

/* 4. EXTRA SMALL PHONES (<= 480px) */
@media (max-width: 480px) {
    .nav-brand-badge {
        display: none;
    }

    .brand-logo-img {
        height: 26px;
    }

    .hero-title {
        font-size: 1.35rem;
    }

    .stat-num {
        font-size: 0.85rem;
    }

    .stat-label {
        font-size: 0.6rem;
    }

    .summary-grid,
    .estimator-kpi-grid {
        grid-template-columns: 1fr;
    }

    .estimator-header-bar > div:last-child {
        grid-template-columns: 1fr !important;
    }

    .estimator-content > div[style*="margin-top: 1.5rem"] > div:last-child {
        grid-template-columns: 1fr !important;
    }

    .summary-banner > div:first-child {
        grid-template-columns: 1fr !important;
    }

    .calc-inputs-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Layer Category Badges & Clean Architecture Helpers */
.layer-cat-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
    line-height: 1;
    border: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.level-breakdown-tag {
    font-size: 0.68rem;
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(51, 65, 85, 0.5);
    padding: 0.2rem 0.45rem;
    border-radius: 0.3rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* =========================================================================
   USER AUTHENTICATION, ROLES & TOKEN SYSTEM STYLES
   ========================================================================= */
.user-auth-hud {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.btn-auth-login {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, #ED6056, #DB4F45);
    color: #ffffff;
    border: none;
    padding: 0.35rem 0.85rem;
    border-radius: 0.45rem;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(237, 96, 86, 0.3);
}

.btn-auth-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(237, 96, 86, 0.45);
}

.user-token-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 0.25rem 0.6rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-token-pill:hover {
    border-color: #38bdf8;
    background: rgba(30, 41, 59, 0.9);
}

.token-icon {
    font-size: 0.85rem;
    color: #38bdf8;
    animation: pulseSlow 2s infinite ease-in-out;
}

.token-mini-bar {
    width: 2.2rem;
    height: 4px;
    background: rgba(51, 65, 85, 0.6);
    border-radius: 2px;
    overflow: hidden;
}

.token-mini-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.user-profile-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid #334155;
    padding: 0.2rem 0.55rem 0.2rem 0.25rem;
    border-radius: 2rem;
    cursor: pointer;
    position: relative;
    user-select: none;
    transition: all 0.2s ease;
}

.user-profile-chip:hover {
    background: rgba(51, 65, 85, 0.8);
    border-color: #475569;
}

.user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ED6056, #DB4F45);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.user-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffffff;
    max-width: 8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-tier-badge {
    font-size: 0.6rem;
    font-weight: 800;
    padding: 0.05rem 0.3rem;
    border-radius: 0.2rem;
    display: inline-block;
    align-self: flex-start;
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 15rem;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 0.6rem;
    padding: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 10100;
    display: none;
    flex-direction: column;
    gap: 0.2rem;
}

.user-dropdown-menu.show {
    display: flex;
}

.dropdown-header {
    padding: 0.4rem 0.5rem;
}

.dropdown-divider {
    height: 1px;
    background: #334155;
    margin: 0.25rem 0;
}

.dropdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0.6rem;
    border-radius: 0.35rem;
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-size: 0.78rem;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: background 0.15s ease;
}

.dropdown-item:hover {
    background: rgba(51, 65, 85, 0.5);
    color: #ffffff;
}

.dropdown-item.text-danger {
    color: #f87171;
}

.dropdown-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.badge-tag {
    font-size: 0.62rem;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    padding: 0.1rem 0.35rem;
    border-radius: 0.2rem;
    font-weight: 700;
}

.auth-tab-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 0.45rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 0.35rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-tab-btn.active {
    background: #1e293b;
    color: #ffffff;
    font-weight: 700;
}

@keyframes pulseSlow {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.8; }
}

@media (max-width: 640px) {
    .no-mobile-sm {
        display: none !important;
    }
}




