/* ═══════════════════════════════════════════════════════════
   SIMULADOR GRUPO TENHA — CSS Responsivo
   Desktop: sidebar clássica + main
   Mobile (<768px): top bar fixo + lista + drawer no fundo
═══════════════════════════════════════════════════════════ */

:root {
    --gold:       #d4a017;
    --gold-light: #e8b94f;
    --gold-grad:  linear-gradient(135deg, #d4a017, #b8880f);
    --dark:       #0a0a0f;
    --dark-2:     #0f172a;
    --dark-3:     #1a2236;
    --border:     rgba(212,160,23,0.18);
    --border-soft:rgba(255,255,255,0.07);
    --text:       #e8eaf0;
    --muted:      #7e8ba4;
    --card:       rgba(26,34,54,0.9);
    --glass:      rgba(15,23,42,0.97);
    --radius:     14px;
    --radius-sm:  9px;
    --ease:       0.28s cubic-bezier(.4,0,.2,1);
    --sidebar-w:  390px;
    --mob-top:    58px;
    --mob-drawer: 400px;
    --mob-finish: 64px;
}

* { margin:0; padding:0; box-sizing:border-box; font-family:'Outfit','Inter',sans-serif; -webkit-tap-highlight-color:transparent; }

/* ════════════════════════════════════
   BASE / GLOBAL
════════════════════════════════════ */
body {
    background: var(--dark-2);
    color: var(--text);
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
}

/* ════════════════════════════════════
   MOBILE TOP BAR (hidden on desktop)
════════════════════════════════════ */
.mob-topbar {
    display: none; /* hidden on desktop */
    position: fixed; top:0; left:0; right:0; z-index:200;
    height: var(--mob-top);
    align-items: center; gap: 8px;
    padding: 0 12px;
    padding-top: env(safe-area-inset-top, 0);
    background: var(--dark);
    border-bottom: 1px solid var(--border);
}
.mob-brand { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.mob-logo  { width:32px; height:32px; border-radius:6px; object-fit:cover; background:#fff; padding:2px; }
.mob-brand-name { font-size:0.88rem; font-weight:800; color:var(--text); white-space:nowrap; }
.mob-brand-name b { color:var(--gold); }
.mob-stats { display:flex; gap:6px; flex:1; justify-content:center; }
.mob-stat  { display:flex; flex-direction:column; align-items:center;
    background:var(--dark-3); border:1px solid var(--border);
    border-radius:7px; padding:3px 8px; }
.mob-stat span { font-size:0.78rem; font-weight:800; color:var(--gold); white-space:nowrap; }
.mob-stat small { font-size:0.52rem; color:var(--muted); text-transform:uppercase; letter-spacing:0.05em; }
.mob-top-actions { display:flex; gap:6px; flex-shrink:0; }

/* ════════════════════════════════════
   APP CONTAINER
════════════════════════════════════ */
.app-container {
    display: flex;
    height: 100%;
    width: 100%;
}

/* ════════════════════════════════════
   SIDEBAR (desktop)
════════════════════════════════════ */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--dark);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    padding: 24px 22px;
    z-index: 10;
}

.sidebar-scroll-content {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 12px;
    padding-right: 6px;
}

/* Handle — oculto no desktop */
.drawer-handle { display: none; }

/* Brand */
.brand {
    display: flex; align-items: center; gap: 13px;
    margin-bottom: 32px;
    padding: 13px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}
.brand-logo {
    width: 50px; height: 50px;
    border-radius: 8px; object-fit: cover;
    background: #fff; padding: 3px; display: block; flex-shrink: 0;
}
.brand-text { display:flex; flex-direction:column; gap:2px; }
.brand h1   { font-size:1.05rem; font-weight:800; letter-spacing:0.4px; color:var(--text); margin:0; line-height:1; }
.brand h1 span { color: var(--gold); }
.brand-sub  { font-size:0.67rem; color:var(--muted); text-transform:uppercase; letter-spacing:0.06em; font-weight:500; }

/* Form title */
.form-title {
    font-size:1rem; font-weight:700;
    color: var(--gold);
    display:flex; align-items:center; gap:8px;
    margin-bottom: 22px;
}
.form-title i { width:18px; height:18px; }

/* ════════════════════════════════════
   FORM GROUPS
════════════════════════════════════ */
.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: 0.75rem; font-weight:700;
    color: var(--muted);
    text-transform: uppercase; letter-spacing:0.05em;
    margin-bottom: 7px;
}

.field-input {
    width: 100%; height: 48px;
    padding: 0 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text); font-size: 0.95rem; outline: none;
    transition: var(--ease);
    -webkit-appearance: none; appearance: none;
    cursor: pointer;
}
.field-input:focus {
    border-color: var(--gold);
    background: rgba(255,255,255,0.07);
    box-shadow: 0 0 0 3px rgba(212,160,23,0.12);
}
.field-input option { background: var(--dark); color: var(--text); }

/* ════════════════════════════════════
   SEGMENTED CONTROL
════════════════════════════════════ */
.seg-control {
    display: flex; gap: 4px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px;
}
.seg-btn {
    flex: 1; height: 40px;
    background: transparent; border: none;
    border-radius: 7px; cursor: pointer;
    color: var(--muted); font-size: 0.82rem; font-weight: 600;
    transition: var(--ease);
}
.seg-btn.active {
    background: var(--gold-grad);
    color: #0a0a0f;
    box-shadow: 0 2px 8px rgba(212,160,23,0.25);
}
.seg-btn:hover:not(.active) { color: var(--text); background: rgba(255,255,255,0.06); }

/* ════════════════════════════════════
   STEPPERS
════════════════════════════════════ */
.dims-row {
    display: flex; align-items: flex-end; gap: 8px; margin-bottom: 10px;
}
.dims-x { font-size:1.3rem; font-weight:300; color:var(--muted); padding-bottom:8px; flex-shrink:0; }
.stepper-group { flex:1; display:flex; flex-direction:column; gap:5px; }
.stepper-lbl   { font-size:0.65rem; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:0.05em; text-align:center; }
.stepper {
    display: flex; align-items: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm); overflow: hidden;
}
.step-btn {
    width: 44px; height: 44px; flex-shrink: 0;
    background: rgba(212,160,23,0.07);
    border: none; cursor: pointer;
    color: var(--gold); font-size: 1.5rem; font-weight: 300; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: var(--ease);
}
.step-btn:hover  { background: rgba(212,160,23,0.16); }
.step-btn:active { background: rgba(212,160,23,0.28); transform: scale(0.9); }
.step-input {
    flex: 1; width: 0; height: 44px;
    background: transparent; border: none; outline: none;
    color: var(--text); font-size: 1.05rem; font-weight: 700;
    text-align: center; -moz-appearance: textfield;
}
.step-input::-webkit-outer-spin-button,
.step-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ════════════════════════════════════
   SIZE CHIPS
════════════════════════════════════ */
.size-chips {
    display: flex; flex-wrap: wrap; gap: 5px; align-items: center;
}
.chips-label { font-size: 0.65rem; color: var(--muted); text-transform: uppercase; letter-spacing:0.05em; font-weight:600; }
.size-chip {
    padding: 4px 10px; height: 28px;
    background: rgba(212,160,23,0.07);
    border: 1px solid rgba(212,160,23,0.2);
    border-radius: 20px; cursor: pointer;
    color: var(--gold-light); font-size: 0.75rem; font-weight: 700;
    transition: var(--ease); display: flex; align-items: center;
}
.size-chip:hover        { background: rgba(212,160,23,0.18); }
.size-chip:active       { transform: scale(0.93); }
.size-chip.active-chip  { background: var(--gold-grad); color: #0a0a0f; }

/* ════════════════════════════════════
   PRICE PREVIEW
════════════════════════════════════ */
.price-preview {
    display: flex; align-items: center; gap: 10px;
    background: rgba(212,160,23,0.06);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px; margin-bottom: 12px;
    flex-shrink: 0;
}
.pp-label { font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.pp-value { font-size: 1.15rem; font-weight: 900; color: var(--gold); flex: 1; }
.pp-area  { font-size: 0.72rem; color: var(--muted); }

.add-btn-container {
    flex-shrink: 0;
}

/* ════════════════════════════════════
   PRICE INFO
════════════════════════════════════ */
.price-info {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-soft);
    font-size: 0.75rem;
    flex-shrink: 0;
}
.price-info p {
    display: flex; gap: 8px; align-items: flex-start;
    color: var(--muted); line-height: 1.5;
}
.price-info i { width:14px; height:14px; color:var(--gold); flex-shrink:0; margin-top:2px; }

/* ════════════════════════════════════
   BUTTONS
════════════════════════════════════ */
.primary-btn {
    width: 100%; height: 50px;
    background: var(--gold-grad); color: #0a0a0f;
    border: none; border-radius: var(--radius-sm);
    font-weight: 800; font-size: 0.95rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 4px 14px rgba(212,160,23,0.22);
    transition: var(--ease);
}
.primary-btn:hover  { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(212,160,23,0.35); }
.primary-btn:active { transform: translateY(0); box-shadow: none; }

.secondary-btn {
    padding: 0 20px; height: 44px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; gap: 8px;
    color: var(--text); font-weight: 600; font-size: 0.88rem; cursor: pointer;
    transition: var(--ease); white-space: nowrap;
}
.secondary-btn:hover  { background: rgba(255,255,255,0.07); border-color: rgba(212,160,23,0.35); color: var(--gold); }
.secondary-btn:active { background: rgba(255,255,255,0.1); }

.cta-btn {
    padding: 0 30px; height: 50px;
    background: var(--gold-grad); color: #0a0a0f;
    border: none; border-radius: var(--radius-sm);
    font-weight: 800; font-size: 0.95rem; cursor: pointer;
    display: flex; align-items: center; gap: 9px;
    box-shadow: 0 4px 16px rgba(212,160,23,0.25);
    transition: var(--ease); white-space: nowrap;
}
.cta-btn:hover  { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(212,160,23,0.38); }
.cta-btn:active { transform: translateY(0); }

.icon-btn {
    width: 36px; height: 36px; border-radius: 8px;
    border: 1px solid var(--border); background: var(--dark-3);
    color: var(--text); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--ease);
}
.icon-btn:hover { border-color: var(--gold); color: var(--gold); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn.danger { color: #ef4444; border-color: rgba(239,68,68,0.25); }
.icon-btn i { width: 16px; height: 16px; }

.tour-fab {
    position: fixed; bottom: 22px; right: 22px;
    z-index: 999; border-radius: 50%;
    width: 48px; height: 48px;
    box-shadow: 0 4px 14px rgba(212,160,23,0.35);
    padding: 0;
}

/* ════════════════════════════════════
   MAIN CONTENT (desktop)
════════════════════════════════════ */
.main-content {
    flex: 1; display: flex; flex-direction: column;
    padding: 36px; overflow-y: auto;
    background: var(--dark-2);
    min-width: 0;
}

.main-header {
    display: flex; justify-content: space-between; align-items: flex-end;
    margin-bottom: 28px; flex-shrink: 0;
}

.summary-cards { display: flex; gap: 18px; flex-wrap: wrap; }

.card {
    display: flex; flex-direction: column;
    background: var(--card);
    border: 1px solid var(--border);
    padding: 14px 22px; border-radius: var(--radius);
    backdrop-filter: blur(12px);
    min-width: 130px;
}
.card .label { font-size:0.72rem; color:var(--muted); font-weight:600; text-transform:uppercase; letter-spacing:0.03em; }
.card .value { font-size:1.7rem; font-weight:900; color:var(--gold); margin-top:2px; }

/* ════════════════════════════════════
   ITEMS LIST
════════════════════════════════════ */
.budget-items-list {
    flex: 1;
    min-height: 280px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 260px);
    backdrop-filter: blur(12px);
    margin-bottom: 24px;
}

.empty-state {
    height: 100%; min-height: 200px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center; color: var(--muted); gap: 14px;
}
.empty-state i { width:56px; height:56px; opacity:0.25; color:var(--gold); }
.empty-state p { font-size:0.9rem; line-height:1.6; }

.croqui-disclaimer {
    background: rgba(212,160,23,0.05); border:1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 16px;
    margin-bottom: 16px; display: flex; gap: 12px; align-items: center;
    font-size: 0.8rem; color: var(--text); line-height: 1.4;
}
.croqui-disclaimer i { color:var(--gold); flex-shrink:0; width:18px; height:18px; }
.croqui-disclaimer small { color:var(--muted); font-size:0.72rem; }

.budget-item {
    display: grid;
    grid-template-columns: 68px 1fr;
    grid-template-rows: auto auto;
    align-items: center; gap: 10px 18px;
    padding: 18px; border-bottom: 1px solid var(--border-soft);
    animation: slideIn 0.3s ease forwards;
}
.budget-item:last-child { border-bottom: none; }

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

.item-icon {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: center;
    width: 68px; height: 68px;
    background: rgba(0,0,0,0.2); border: 1px solid var(--border-soft);
    border-radius: 9px; overflow: hidden; cursor: pointer;
    transition: transform 0.2s;
}
.item-icon:hover { transform: scale(1.05); }

.item-info {
    grid-column: 2;
    grid-row: 1;
}
.item-info h3 { font-size:0.95rem; font-weight:700; color:var(--text); }
.item-info p  { font-size:0.78rem; color:var(--muted); margin-top:3px; line-height:1.4; }

.item-price {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    font-weight:800; font-size:1.08rem; color:var(--gold); white-space:nowrap;
}

.item-actions {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 6px;
}
.action-btn {
    width: 34px; height: 34px;
    background: none; border: none; cursor: pointer;
    border-radius: 6px; display: flex; align-items: center; justify-content: center;
    transition: background 0.2s, color 0.2s;
}
.action-btn i {
    width: 16px; height: 16px;
}
.edit-btn { color: var(--gold); }
.edit-btn:hover { background: rgba(212, 160, 23, 0.15); }
.duplicate-btn { color: #3b82f6; }
.duplicate-btn:hover { background: rgba(59, 130, 246, 0.15); }
.delete-btn { color: #ef4444; }
.delete-btn:hover { background: rgba(239, 68, 68, 0.15); }

/* ════════════════════════════════════
   MAIN FOOTER (desktop)
════════════════════════════════════ */
.main-footer {
    display: flex; justify-content: space-between;
    align-items: center; gap: 30px;
    flex-shrink: 0;
}
.disclaimer { font-size:0.78rem; color:var(--muted); max-width:500px; line-height:1.5; }

/* ════════════════════════════════════
   MOBILE FINISH BAR (hidden on desktop)
════════════════════════════════════ */
.mob-finish-bar { display: none; }

/* ════════════════════════════════════
   MODALS
════════════════════════════════════ */
.modal {
    display: none; position: fixed; z-index: 1000; inset: 0;
    background: rgba(0,0,0,0.72);
    align-items: center; justify-content: center;
    backdrop-filter: blur(8px);
}
.modal.active { display: flex; }

.modal-content {
    background: var(--glass);
    border: 1px solid var(--border);
    padding: 36px 30px;
    border-radius: var(--radius);
    width: 90%; max-width: 480px;
    position: relative;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
    animation: modalIn 0.3s cubic-bezier(.4,0,.2,1) forwards;
    max-height: 90vh; overflow-y: auto;
}
@keyframes modalIn {
    from { opacity:0; transform:scale(0.95) translateY(16px); }
    to   { opacity:1; transform:scale(1) translateY(0); }
}

.close-modal {
    position:absolute; right:16px; top:14px;
    font-size:26px; cursor:pointer; color:var(--muted);
    width:34px; height:34px; display:flex;
    align-items:center; justify-content:center;
    border-radius:7px; transition:background 0.2s;
}
.close-modal:hover { color:var(--text); background:rgba(255,255,255,0.06); }

.modal-content h2 { margin-bottom:6px; color:var(--gold); font-weight:800; font-size:1.25rem; }
.modal-content p  { color:var(--muted); margin-bottom:14px; font-size:0.88rem; }

/* ════════════════════════════════════
   OVERLAY (mobile)
════════════════════════════════════ */
.drawer-overlay {
    display:none; position:fixed; inset:0;
    z-index:94; background:rgba(0,0,0,0.45);
    backdrop-filter:blur(3px);
}
.drawer-overlay.active { display:block; }

/* ════════════════════════════════════
   HELPERS
════════════════════════════════════ */
.hidden { display:none !important; }
.spin   { animation:spin 1s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }

::-webkit-scrollbar { width:5px; height:5px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:var(--dark-3); border-radius:4px; }
::-webkit-scrollbar-thumb:hover { background:var(--gold); }


/* ════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE (<= 768px)
   Sidebar vira bottom drawer. Top bar aparece.
════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

    /* Altera o tamanho padrão do drawer quando em modo Drywall no mobile para dar espaço ao Canvas */
    body.mode-drywall {
        --mob-drawer: 50px;
    }

    /* Ajusta a barra de ferramentas do CAD no mobile para evitar sobreposição com o botão fullscreen */
    #cad-action-bar {
        max-width: calc(100% - 60px) !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
        top: 8px !important;
        left: 8px !important;
    }
    .cad-action-btn {
        width: 32px !important;
        height: 32px !important;
        padding: 4px !important;
    }
    .cad-action-btn i {
        width: 15px !important;
        height: 15px !important;
    }

    /* Otimizações de Layout para o configurador de Drywall em Tela Cheia no Mobile */
    #drywall-configurator.fullscreen-active {
        padding: 8px !important;
        gap: 8px !important;
        overflow: hidden !important; /* Desativa scroll na página toda */
        z-index: 10000 !important; /* Cobre tudo, inclusive a sidebar/drawer */
    }
    #drywall-configurator.fullscreen-active .config-header {
        padding-bottom: 6px !important;
    }
    #drywall-configurator.fullscreen-active .view-modes-group,
    #drywall-configurator.fullscreen-active #client-summary-panel,
    #drywall-configurator.fullscreen-active #tech-breakdown-panel,
    #drywall-configurator.fullscreen-active .file-actions-container {
        display: none !important; /* Esconde resumos secundários e botões de arquivo */
    }
    #drywall-configurator.fullscreen-active .viewport-container {
        flex: 1 !important;
        height: auto !important;
        min-height: 180px !important;
    }
    #drywall-configurator.fullscreen-active #add-item-btn-configurator {
        margin-top: 4px !important;
        margin-bottom: 4px !important;
        height: 44px !important;
    }
    
    /* Botão de Tela Cheia estilizado como FAB no mobile */
    #btn-fullscreen-toggle {
        width: 44px !important;
        height: 44px !important;
        border-radius: 50% !important;
        background: var(--gold-grad) !important;
        color: var(--dark) !important;
        box-shadow: 0 4px 12px rgba(212,160,23,0.4) !important;
        top: 12px !important;
        right: 12px !important;
        border: none !important;
    }
    #btn-fullscreen-toggle i {
        width: 20px !important;
        height: 20px !important;
    }

    /* Faz o body usar o espaço correto */
    body { overflow: hidden; }

    /* Mostra top bar mobile */
    .mob-topbar { display: flex; }

    /* Mostra barra de finalizar acima do drawer */
    .mob-finish-bar {
        display: block;
        position: fixed;
        bottom: var(--mob-drawer);
        left: 0; right: 0; z-index: 93;
        padding: 8px 12px;
        background: linear-gradient(to top, var(--dark-2) 70%, transparent);
    }
    .mob-finish-bar .cta-btn { width: 100%; justify-content: center; }

    /* App container: só main fica visível normalmente */
    .app-container {
        flex-direction: column;
        height: 100%;
    }

    /* Main content: scrollável, entre top bar e drawer+finish */
    .main-content {
        position: fixed;
        top: var(--mob-top);
        left: 0; right: 0;
        bottom: calc(var(--mob-drawer) + var(--mob-finish));
        padding: 12px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Esconde header desktop (summary cards + clear-budget) */
    .main-header { display: none; }

    /* Footer desktop esconde no mobile */
    .main-footer { display: none; }

    /* Items list ocupa tudo no mobile */
    .budget-items-list {
        max-height: none;
        height: 100%;
        margin-bottom: 0;
        padding: 14px;
    }

    /* ── SIDEBAR → BOTTOM DRAWER ── */
    .sidebar {
        position: fixed;
        bottom: 0; left: 0; right: 0;
        width: 100%;
        height: var(--mob-drawer);
        border-right: none;
        border-top: 2px solid var(--border);
        border-radius: 20px 20px 0 0;
        z-index: 95;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 0 0 24px;
        transition: height var(--ease);
        -webkit-overflow-scrolling: touch;
    }
    .sidebar.expanded { height: 88vh; }

    /* Esconde brand e price-info dentro do drawer */
    .sidebar .brand        { display: none; }
    .sidebar .price-info   { display: none; }
    .sidebar .form-title   { display: none; }

    /* Mostra o drawer handle */
    .drawer-handle {
        display: flex;
        flex-direction: column; align-items: center; gap: 6px;
        padding: 10px 14px 8px;
        cursor: pointer; user-select: none;
        border-bottom: 1px solid var(--border-soft);
        flex-shrink: 0;
        position: sticky; top: 0;
        background: var(--dark); z-index: 2;
    }
    .handle-bar {
        width: 38px; height: 4px;
        background: var(--muted); border-radius: 4px; opacity: 0.45;
    }
    .drawer-title {
        font-size: 0.82rem; font-weight: 700; color: var(--gold);
        display: flex; align-items: center; gap: 6px;
    }
    .drawer-title i { width: 15px; height: 15px; }

    /* Form dentro do drawer tem padding lateral */
    .add-item-form { padding: 0 14px; }

    /* Itens do budget menores no mobile */
    .budget-item {
        display: grid;
        grid-template-columns: 52px 1fr;
        grid-template-rows: auto auto;
        gap: 6px 10px;
        padding: 12px;
        align-items: center;
    }
    .item-icon {
        grid-column: 1;
        grid-row: 1 / span 2;
        width: 52px; height: 52px;
        align-self: center;
    }
    .item-info {
        grid-column: 2;
        grid-row: 1;
    }
    .item-info h3 { font-size: 0.84rem; }
    .item-info p  { font-size: 0.7rem; }
    .item-price {
        grid-column: 2;
        grid-row: 2;
        justify-self: start;
        font-size: 0.9rem;
    }
    .item-actions {
        grid-column: 2;
        grid-row: 2;
        justify-self: end;
    }
    .item-actions .action-btn {
        width: 30px; height: 30px;
    }

    /* Botão flutuante de tour → visível e flutuante acima do drawer */
    .tour-fab {
        display: flex !important;
        position: fixed !important;
        bottom: calc(var(--mob-drawer) + var(--mob-finish) + 16px) !important;
        right: 16px !important;
        z-index: 90 !important; /* acima do conteúdo principal, mas abaixo do drawer expandido (z-index: 95) */
    }

    /* Modals sobem pelo fundo no mobile */
    .modal { align-items: flex-end; }
    .modal-content {
        width: 100%; max-width: 100%;
        border-radius: 20px 20px 0 0;
        padding: 24px 18px 36px;
        animation: slideUp 0.3s cubic-bezier(.4,0,.2,1) forwards;
    }
    @keyframes slideUp {
        from { opacity:0; transform:translateY(30px); }
        to   { opacity:1; transform:translateY(0); }
    }

    /* Steppers maiores no touch */
    .step-btn  { width: 50px; height: 50px; font-size: 1.6rem; }
    .step-input { height: 50px; font-size: 1.1rem; }
    .seg-btn   { height: 44px; font-size: 0.8rem; }
    .field-input { height: 50px; font-size: 1rem; }
    .primary-btn { height: 52px; font-size: 1rem; }
}

/* ════════════════════════════════════
   Tablet (769–1024px) — sidebar menor
════════════════════════════════════ */
@media (min-width: 769px) and (max-width: 1100px) {
    :root { --sidebar-w: 320px; }
    .main-content { padding: 24px; }
    .summary-cards { gap: 12px; }
    .card { padding: 12px 16px; min-width: 110px; }
    .card .value { font-size: 1.4rem; }
    .budget-items-list { max-height: calc(100vh - 230px); }
}

/* ════════════════════════════════════
   TOTAL SUMMARY CARD & SUMMARY LINE
   ════════════════════════════════════ */
.total-summary-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
    backdrop-filter: blur(12px);
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.summary-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--muted);
}

.summary-line span:last-child {
    font-weight: 700;
    color: var(--text);
}

.summary-line.grand-total {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--gold);
}

.summary-line.grand-total span:last-child {
    font-size: 1.5rem;
    font-weight: 900;
    background: var(--gold-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ════════════════════════════════════
   CONFIGURADOR VISUAL 2D + 3D
   ════════════════════════════════════ */

/* Abas */
.cad-tab {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--muted);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--ease);
}
.cad-tab:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text);
}
.cad-tab.active {
    background: var(--gold-grad);
    border-color: var(--gold);
    color: var(--dark);
}

/* Modos Cliente / Técnico */
.mode-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--muted);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: var(--ease);
}
.mode-btn:hover {
    color: var(--text);
    border-color: rgba(255,255,255,0.2);
}
.mode-btn.active {
    background: rgba(212,160,23,0.15);
    border-color: var(--gold);
    color: var(--gold);
}

/* Toolbar Ações Rápidas do CAD */
.cad-action-btn {
    background: rgba(30,41,59,0.7);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--text);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--ease);
}
.cad-action-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: var(--gold);
}
.cad-action-btn.active {
    background: var(--gold-grad);
    color: var(--dark);
    border-color: var(--gold);
}
.cad-action-btn.danger:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

/* Câmeras do 3D */
.cam-preset-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: 800;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--ease);
}
.cam-preset-btn:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text);
}

/* Alertas Semáforo */
.alert-box {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    margin-bottom: 6px;
    border-left: 4px solid transparent;
    box-sizing: border-box;
}
.alert-box.success {
    background: rgba(39,174,96,0.1);
    color: #2ecc71;
    border-left-color: #27ae60;
}
.alert-box.warning {
    background: rgba(241,196,15,0.08);
    color: #f1c40f;
    border-left-color: #f39c12;
}
.alert-box.danger {
    background: rgba(231,76,60,0.1);
    color: #e74c3c;
    border-left-color: #c0392b;
}

/* Tabelas e visual do modo técnico */
#tech-walls-table th, #tech-walls-table td {
    padding: 6px 4px;
}
#tech-walls-table tbody tr {
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
#tech-walls-table tbody tr:hover {
    background: rgba(255,255,255,0.01);
}

/* ════════════════════════════════════
   TELA CHEIA VIRTUAL & DICAS
   ════════════════════════════════════ */

/* Configuração de Tela Cheia no configurador */
#drywall-configurator.fullscreen-active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    background: #0d0e12 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 16px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
}

/* Forçar viewport container a usar espaço restante na tela cheia */
#drywall-configurator.fullscreen-active .viewport-container {
    flex: 1 !important;
    height: auto !important;
    min-height: 220px !important;
}

/* Stats de orçamento em tela cheia */
.fullscreen-budget-stats {
    display: none;
    justify-content: space-around;
    align-items: center;
    gap: 12px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(212, 160, 23, 0.2);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

#drywall-configurator.fullscreen-active .fullscreen-budget-stats {
    display: flex !important;
}

.fullscreen-budget-stats .f-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
}

.fullscreen-budget-stats .f-stat-label {
    font-size: 0.7rem;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
}

.fullscreen-budget-stats .f-stat-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--gold);
}

/* Dica de tela cheia para dispositivos móveis */
.fullscreen-hint {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(212, 160, 23, 0.08);
    border: 1px solid rgba(212, 160, 23, 0.2);
    border-radius: 8px;
    padding: 12px;
    font-size: 0.85rem;
    color: var(--gold-light);
    margin: 14px 0;
    text-align: center;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ease);
}

.fullscreen-hint:hover {
    background: rgba(212, 160, 23, 0.15);
}

.fullscreen-hint i, .fullscreen-hint svg {
    width: 16px;
    height: 16px;
    color: var(--gold);
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .fullscreen-hint {
        display: flex;
    }
}

/* Ocultar dica quando estiver em tela cheia ou se o configurador estiver escondido */
#drywall-configurator.fullscreen-active + #fullscreen-hint,
#drywall-configurator.hidden + #fullscreen-hint {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════
   CUSTOM MODERN TOUR SYSTEM (onboarding tour)
═══════════════════════════════════════════════════════════ */

/* Bloqueador de fundo e foco do tour */
.tour-overlay-blocker {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 10, 15, 0.45);
    backdrop-filter: blur(4px);
    z-index: 99990;
    pointer-events: auto;
    transition: opacity 0.28s cubic-bezier(.4,0,.2,1);
}

/* Efeito de destaque do elemento focado */
.tour-highlighted-element {
    position: relative !important;
    z-index: 99995 !important;
    box-shadow: 0 0 0 99999px rgba(10, 10, 15, 0.72), 0 0 0 2px var(--gold), 0 0 25px rgba(212, 160, 23, 0.45) !important;
    outline: 2px solid var(--gold) !important;
    border-radius: 4px;
    pointer-events: none !important;
}

/* Card flutuante de dicas (Glassmorphism premium) */
.tour-tooltip-card {
    position: fixed;
    z-index: 100000;
    width: 320px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(212, 160, 23, 0.35);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 16px 20px;
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    transform: scale(0.95);
    opacity: 0;
    transition: transform var(--ease), opacity var(--ease), top var(--ease), left var(--ease);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tour-tooltip-card.active {
    transform: scale(1);
    opacity: 1;
}

/* Elementos do Card */
.tour-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
}

.tour-card-step-badge {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gold);
    background: rgba(212, 160, 23, 0.12);
    padding: 2px 8px;
    border-radius: 99px;
    border: 1px solid rgba(212, 160, 23, 0.2);
}

.tour-card-close-btn {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.tour-card-close-btn:hover {
    color: #e74c3c;
}

.tour-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    margin: 4px 0 0 0;
}

.tour-card-body {
    font-size: 0.88rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.88);
}

.tour-card-body b {
    color: var(--gold-light);
}

.tour-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    gap: 8px;
}

.tour-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--ease);
}

.tour-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
}

.tour-btn.tour-btn-next {
    background: var(--gold-grad);
    border: none;
    color: #000;
}

.tour-btn.tour-btn-next:hover {
    background: var(--gold-light);
    box-shadow: 0 0 8px rgba(212, 160, 23, 0.3);
}

/* Modificação para Mobile */
@media (max-width: 768px) {
    .tour-tooltip-card {
        width: calc(100% - 24px);
        bottom: 12px;
        left: 12px !important;
        right: 12px;
        top: auto !important; /* Fixa embaixo para não quebrar a visualização */
        transform: translateY(20px) scale(0.95);
    }
    
    .tour-tooltip-card.active {
        transform: translateY(0) scale(1);
    }
}

/* Estilização dos Botões de Opção do Guia Funcional */
.guide-options-list {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.guide-opt-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: var(--ease);
}
.guide-opt-btn:hover {
    background: rgba(212, 160, 23, 0.08);
    border-color: rgba(212, 160, 23, 0.35);
    transform: translateY(-2px);
}
.guide-opt-btn i, .guide-opt-btn svg {
    width: 24px;
    height: 24px;
    color: var(--gold);
    flex-shrink: 0;
}
.guide-opt-btn .text {
    display: flex;
    flex-direction: column;
}
.guide-opt-btn .text strong {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}
.guide-opt-btn .text span {
    font-size: 0.76rem;
    color: var(--muted);
    line-height: 1.3;
    margin-top: 2px;
}

/* Animação de pulsação para o botão flutuante */
@keyframes pulse-gold {
    0% {
        box-shadow: 0 0 0 0 rgba(212, 160, 23, 0.6);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(212, 160, 23, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(212, 160, 23, 0);
    }
}
.tour-fab {
    animation: pulse-gold 2s infinite;
    border: 1px solid rgba(212, 160, 23, 0.4) !important;
}

