/* esquematizador.css — Estilos del Esquematizador Público de ACAVIDRIO */

:root {
    --turquesa: #0EA5A0;
}

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

body {
    font-family: 'Open Sans', sans-serif;
    background-color: #f0f4f8;
    color: #2d3748;
    min-height: 100vh;
}

/* ══════════════════════════════════════
   ELEMENTOS STANDALONE (página independiente)
   ══════════════════════════════════════ */

/* ── Botón regresar ── */
.esq-regresar {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #374151;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    transition: border-color .2s, color .2s;
}
.esq-regresar:hover {
    border-color: var(--turquesa);
    color: var(--turquesa);
}
.esq-regresar svg { flex-shrink: 0; }

/* ── Mensaje pantalla chica (< 1024px) ── */
.esq-pantalla-chica {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #f4f5f7;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    gap: 1.2rem;
}
.esq-pantalla-chica svg { color: var(--turquesa); }
.esq-pantalla-chica h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1a1a;
}
.esq-pantalla-chica p {
    font-size: 0.9rem;
    color: #6b7280;
    max-width: 400px;
    line-height: 1.5;
}
.esq-pantalla-chica a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    background: var(--turquesa);
    color: #fff;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity .2s;
}
.esq-pantalla-chica a:hover { opacity: .85; }

@media (max-width: 1023px) {
    .esq-pantalla-chica { display: flex; }
    .app-layout { display: none !important; }
    .esq-regresar { display: none !important; }
}

/* ══════════════════════════════���═══════
   LAYOUT PRINCIPAL — 3 COLUMNAS
   ═══════���═════════════��════════════════ */

.app-layout {
    display: flex; height: 100vh;
}

/* ── Panel izquierdo ─��� */
.side-panel {
    width: 360px; min-width: 360px;
    background: white; border-right: 1px solid #e2e8f0;
    display: flex; flex-direction: column; overflow: hidden;
}

.side-panel-header {
    padding: 14px 20px; padding-top: 48px; border-bottom: 1px solid #e2e8f0;
    display: flex; justify-content: space-between; align-items: center;
}

.side-panel-header h1 { font-size: 1.05rem; color: #1a365d; }

.btn-sm {
    padding: 7px 14px; font-size: 0.8rem; font-weight: 600;
    border: none; border-radius: 6px; cursor: pointer; transition: background 0.2s;
}
.btn-save-sm       { background: #38a169; color: white; }
.btn-save-sm:hover { background: #2f855a; }
.btn-quote-sm       { background: #2b6cb0; color: white; }
.btn-quote-sm:hover { background: #2c5282; }
.btn-load-sm              { background: #718096; color: white; }
.btn-load-sm:hover        { background: #4a5568; }
.btn-load-sm:disabled     { background: #cbd5e0; color: #a0aec0; cursor: not-allowed; opacity: 0.6; }
.header-buttons { display: flex; gap: 6px; }

/* ── Zona superior: Lista de vidrios ── */
.glass-list-zone {
    border-bottom: 2px solid #e2e8f0;
    padding: 10px 16px;
    background: #f7fafc;
    flex-shrink: 0;
    max-height: 260px;
    overflow-y: auto;
}

.glass-list-title {
    font-size: 0.75rem; font-weight: 700; color: #4a5568;
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px;
    display: flex; justify-content: space-between; align-items: center;
}

.glass-list { list-style: none; }

.glass-row {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px; margin-bottom: 4px;
    border-radius: 7px; cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.15s;
    background: white;
}
.glass-row:hover { border-color: #bee3f8; }
.glass-row.active {
    border-color: #3182ce;
    background: #ebf8ff;
}

.glass-row .glass-num {
    font-weight: 700; font-size: 0.85rem; color: #2b6cb0;
    min-width: 22px;
}
.glass-row .glass-dims {
    font-size: 0.78rem; color: #4a5568; flex: 1;
}
.glass-row .glass-placement {
    font-size: 0.65rem; color: #718096;
    background: #edf2f7; padding: 1px 6px; border-radius: 3px;
}
.glass-row .glass-delete {
    background: none; border: none; color: #e53e3e; cursor: pointer;
    font-size: 0.85rem; padding: 2px 5px; border-radius: 4px;
    opacity: 0.5; transition: opacity 0.2s;
}
.glass-row .glass-delete:hover { opacity: 1; background: #fed7d7; }

.btn-add-glass {
    display: block; width: 100%; padding: 8px;
    background: #2b6cb0; color: white; font-size: 0.82rem; font-weight: 600;
    border: none; border-radius: 7px; cursor: pointer; margin-top: 8px;
    position: relative;
    transition: background 0.25s, color 0.25s;
}
.btn-add-glass:hover:not(:disabled) { background: #2c5282; }
.btn-add-glass:disabled {
    background: #cbd5e0; color: #a0aec0;
    cursor: not-allowed; pointer-events: auto;
}
.btn-add-glass:disabled::after,
.btn-add:disabled::after {
    content: 'Vidrio activo sin dimensiones';
    position: absolute; bottom: calc(100% + 6px); left: 50%;
    transform: translateX(-50%);
    background: #2d3748; color: white;
    font-size: 0.72rem; font-weight: 400;
    padding: 4px 8px; border-radius: 5px;
    white-space: nowrap; pointer-events: none;
    opacity: 0; transition: opacity 0.15s; z-index: 100;
}
.btn-add-glass:disabled:hover::after,
.btn-add:disabled:hover::after { opacity: 1; }

/* ── Zona inferior: Controles del vidrio seleccionado ─��� */
.side-panel-body {
    flex: 1; overflow-y: auto; padding: 14px 16px;
}

.section-title {
    font-size: 0.78rem; font-weight: 700; color: #4a5568;
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px;
}

.active-glass-label {
    font-size: 0.9rem; font-weight: 700; color: #2b6cb0;
    margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.active-glass-label .badge {
    background: #2b6cb0; color: white; font-size: 0.7rem;
    padding: 2px 8px; border-radius: 10px;
}

/* Formularios compactos */
.form-box {
    background: #f7fafc; border-radius: 10px; padding: 12px; margin-bottom: 14px;
    border: 1px solid #e2e8f0;
}
.form-box.form-box-sm { padding: 8px 12px; margin-bottom: 10px; }

.form-box .field { margin-bottom: 8px; }
.form-box .field:last-child { margin-bottom: 0; }
.form-box .field label {
    display: block; font-weight: 600; margin-bottom: 2px; font-size: 0.8rem;
}
.form-box .field input, .form-box .field select {
    width: 100%; padding: 7px 9px; border: 2px solid #e2e8f0;
    border-radius: 7px; font-size: 0.88rem; transition: border-color 0.2s;
}
.form-box.form-box-sm .field input,
.form-box.form-box-sm .field select {
    padding: 5px 8px; font-size: 0.85rem;
}
.form-box .field input:focus, .form-box .field select:focus {
    outline: none; border-color: #3182ce;
}

.row-2 { display: flex; gap: 10px; }
.row-2 .field { flex: 1; }

.btn-add {
    display: block; width: 100%; padding: 8px;
    background: #38a169; color: white; font-size: 0.82rem; font-weight: 600;
    border: none; border-radius: 7px; cursor: pointer; margin-top: 8px;
    position: relative;
    transition: background 0.25s, color 0.25s;
}
.btn-add:hover:not(:disabled) { background: #2f855a; }
.btn-add:disabled {
    background: #cbd5e0; color: #a0aec0;
    cursor: not-allowed; pointer-events: auto;
}

.divider {
    border: none; border-top: 1px solid #e2e8f0; margin: 12px 0;
}

/* Lista de elementos */
.items-list { list-style: none; }

.item-card {
    background: white; border: 1px solid #e2e8f0;
    border-radius: 8px; margin-bottom: 8px; overflow: hidden;
}

.item-card-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 10px; background: #f7fafc; border-bottom: 1px solid #e2e8f0;
}

.item-type-tag {
    font-weight: 700; font-size: 0.68rem; text-transform: uppercase;
    padding: 2px 8px; border-radius: 4px; display: inline-block;
}
.type-barreno { background: #ebf8ff; color: #2b6cb0; }
.type-resaque { background: #fefcbf; color: #975a16; }
.type-descuadre { background: #fed7e2; color: #97266d; }
.type-saque { background: #e9d5ff; color: #5b21b6; }

.item-header-actions { display: flex; align-items: center; gap: 6px; }

.btn-delete {
    background: none; border: none; color: #e53e3e; cursor: pointer;
    font-size: 1rem; padding: 2px 6px; border-radius: 4px; transition: background 0.2s;
}
.btn-delete:hover { background: #fed7d7; }

.item-card-body {
    padding: 6px 10px; display: flex; flex-direction: column; gap: 5px;
}

.item-row { display: flex; gap: 8px; }

.item-card-body .mini-field { flex: 1; min-width: 0; }
.item-card-body .mini-field label {
    display: block; font-size: 0.66rem; font-weight: 600; color: #718096;
    margin-bottom: 2px; text-transform: uppercase; letter-spacing: 0.3px;
}
.item-card-body .mini-field select,
.item-card-body .mini-field input {
    width: 100%; padding: 4px 6px; border: 1.5px solid #e2e8f0;
    border-radius: 5px; font-size: 0.8rem; transition: border-color 0.2s;
}
.item-card-body .mini-field select:focus,
.item-card-body .mini-field input:focus {
    outline: none; border-color: #3182ce;
}
.item-card-body .mini-field.field-dist { flex: 0 0 75px; }

.item-checks {
    display: flex; flex-direction: row; align-items: center; gap: 10px;
    padding-left: 4px;
}
.item-checks .mini-check {
    display: flex; align-items: center; gap: 4px;
    font-size: 0.7rem; color: #4a5568; cursor: pointer; user-select: none;
    white-space: nowrap;
}
.item-checks .mini-check input { cursor: pointer; accent-color: #6b21a8; }

.elem-field-label {
    font-size: 0.62rem; font-weight: 600; color: #a0aec0;
    text-transform: uppercase; letter-spacing: 0.02em;
    line-height: 1; margin-bottom: 2px; white-space: nowrap;
}

.empty-msg { font-size: 0.8rem; color: #a0aec0; font-style: italic; padding: 4px 0; }

/* ── Sección de colocación ── */
.placement-box {
    background: #fffbeb; border: 1px solid #f6e05e; border-radius: 10px;
    padding: 10px 12px; margin-bottom: 14px;
}
.placement-box .section-title { color: #975a16; margin-bottom: 6px; }
.placement-box .field {
    display: flex; align-items: center; gap: 5px;
}
.placement-box .field label {
    margin-bottom: 0; white-space: nowrap;
}
.placement-box .field select {
    flex: 1; min-width: 0;
}

/* ══════════��═══════════════════════════
   PANEL CENTRAL — CANVAS
   ══════════════════════════════════════ */

.canvas-panel {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 30px; overflow: auto; background: #f0f4f8;
}

.drawing-title {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 4px; justify-content: center;
}
.drawing-title label {
    font-size: 1.05rem; font-weight: 700; color: #1a365d;
    white-space: nowrap;
}
.drawing-title input {
    font-size: 1.1rem; font-weight: 700; color: #1a365d;
    border: none; border-bottom: 2px solid #bee3f8;
    background: transparent; outline: none; min-width: 220px;
    padding: 2px 4px; text-align: left; transition: border-color 0.2s;
}
.drawing-title input:focus {
    border-bottom-color: #3182ce;
}
.drawing-title input::placeholder {
    font-weight: 400; color: #a0aec0;
}
.drawing-specs {
    font-size: 0.88rem; color: #4a5568; margin-bottom: 16px; text-align: center;
}

.placeholder-msg {
    font-size: 1rem; color: #a0aec0; text-align: center;
}

canvas { display: block; background: white; border-radius: 8px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
canvas.drag-hover { cursor: grab; }
canvas.dragging   { cursor: grabbing; }

/* ═════���════════════════════════════���═══
   PANEL DERECHO — HERRAMIENTAS
   ═════════════���════════════════════════ */

.tools-panel {
    width: 230px; min-width: 230px; max-width: 230px;
    background: #ffffff; border-left: 1px solid #e2e8f0;
    display: flex; flex-direction: column; overflow: hidden;
}
.tools-panel-header {
    padding: 12px 14px 10px; border-bottom: 1px solid #e2e8f0;
    background: #f7fafc; flex-shrink: 0;
}
.tools-panel-header h2 {
    font-size: 0.88rem; font-weight: 700; color: #1a365d;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.tools-panel-body {
    flex: 1; overflow-y: auto; padding: 14px 14px;
}

/* ── Esquemas predefinidos ── */
.esquemas-section-title {
    font-size: 0.72rem; font-weight: 700; color: #4a5568;
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.esquemas-desc {
    font-size: 0.75rem; color: #718096; font-style: italic;
    min-height: 32px; margin: 8px 0;
    line-height: 1.4;
}
.esquemas-count {
    font-size: 0.72rem; color: #975a16; font-weight: 600;
    margin-bottom: 10px;
}
.btn-apply-scheme {
    width: 100%; padding: 8px 10px;
    background: #744210; color: white;
    border: none; border-radius: 7px; cursor: pointer;
    font-size: 0.82rem; font-weight: 600;
    transition: background 0.15s;
}
.btn-apply-scheme:hover { background: #975a16; }
.btn-apply-scheme:disabled { background: #cbd5e0; cursor: not-allowed; }

.btn-transform {
    width: 100%; padding: 8px 10px;
    background: #2b6cb0; color: white;
    border: none; border-radius: 7px; cursor: pointer;
    font-size: 0.82rem; font-weight: 600;
    transition: background 0.15s; margin-bottom: 6px;
}
.btn-transform:hover  { background: #2c5282; }
.btn-transform:disabled { background: #cbd5e0; cursor: not-allowed; }

.btn-transform-danger {
    width: 100%; padding: 8px 10px;
    background: #c53030; color: white;
    border: none; border-radius: 7px; cursor: pointer;
    font-size: 0.82rem; font-weight: 600;
    transition: background 0.15s; margin-bottom: 6px;
}
.btn-transform-danger:hover  { background: #9b2c2c; }
.btn-transform-danger:disabled { background: #cbd5e0; cursor: not-allowed; }

/* ════���═════════════════════════════════
   COTIZADOR (visual — bloqueado PRO)
   ═��═══════════════��════════════════════ */

.cotizador-field-row {
    display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
}
.cotizador-field-row label {
    font-size: 0.78rem; font-weight: 600; color: #4a5568; white-space: nowrap;
    min-width: 52px;
}
.cotizador-field-row select {
    flex: 1; padding: 5px 6px; border: 1px solid #cbd5e0; border-radius: 6px;
    font-size: 0.83rem; color: #1a202c; background: #fff; outline: none;
    min-width: 0; cursor: pointer;
}
.cotizador-field-row select:focus { border-color: #3182ce; }

/* Segmented control */
.seg-control {
    display: flex; width: 100%; margin-bottom: 10px;
    border: 1px solid #cbd5e0; border-radius: 7px; overflow: hidden;
}
.seg-control input[type="radio"] { display: none; }
.seg-control label {
    flex: 1; text-align: center; padding: 6px 4px;
    font-size: 0.78rem; font-weight: 600; color: #4a5568;
    cursor: pointer; background: #fff; transition: background 0.15s, color 0.15s;
    border-right: 1px solid #cbd5e0; user-select: none;
}
.seg-control label:last-of-type { border-right: none; }
.seg-control input[type="radio"]:checked + label {
    background: #2b6cb0; color: #fff;
}

.cotizador-box {
    background: #f7fafc; border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 10px 12px; display: flex; flex-direction: column; gap: 8px;
}
.cotizador-row {
    display: flex; justify-content: space-between; align-items: center; gap: 6px;
}
.cotizador-row label {
    font-size: 0.8rem; color: #4a5568; font-weight: 600; white-space: nowrap;
}
.cotizador-row input {
    width: 100px; padding: 4px 8px; border: 1px solid #cbd5e0; border-radius: 5px;
    font-size: 0.85rem; color: #1a202c; background: #fff; text-align: right;
    outline: none;
}
.cotizador-row input:focus { border-color: #3182ce; }
.cotizador-row input[readonly] {
    background: #edf2f7; color: #2d3748; cursor: default; border-color: #e2e8f0;
}
.cotizador-divider {
    border: none; border-top: 1px solid #cbd5e0; margin: 2px 0;
}
.cotizador-row.total label { font-size: 0.88rem; color: #1a365d; font-weight: 700; }
.cotizador-row.total input { font-weight: 700; color: #1a365d; font-size: 0.9rem; }

/* ══════════════════════════════════════
   BADGES Y OVERLAYS PRO
   ══════���═══════════��═══════════════════ */

.pro-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f6ad55 0%, #ed8936 100%);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    margin-left: 4px;
    vertical-align: middle;
    text-transform: uppercase;
}

.cotizador-pro-wrap {
    position: relative;
}

.pro-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 8px;
    z-index: 10;
}
.pro-overlay p {
    font-size: 0.82rem;
    color: #4a5568;
    text-align: center;
    font-weight: 600;
}

.btn-pro-contact {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: #25D366;
    color: #fff;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.2s;
}
.btn-pro-contact:hover { opacity: 0.85; }

/* ════════════════════════════════════════
   CONTADOR DE SOLICITUDES RESTANTES
   ════════════════════════════════════════ */

.esq-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    padding: 6px 12px;
}
.esq-topbar .esq-regresar {
    position: static;
}
.esq-contador {
    background: rgba(26, 54, 93, 0.88);
    color: #e2e8f0;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    user-select: none;
    transition: background 0.3s, color 0.3s;
    white-space: nowrap;
}
.esq-contador.warning {
    background: rgba(221, 107, 32, 0.92);
    color: #fff;
}
.esq-contador.danger {
    background: rgba(229, 62, 62, 0.92);
    color: #fff;
}

/* ════════════════════════════════════════
   OVERLAY LÍMITE ALCANZADO
   ════════════════════════════════════════ */

.esq-limite-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}
.esq-limite-card {
    background: #fff;
    border-radius: 16px;
    padding: 36px 40px;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
}
.esq-limite-card h2 {
    font-size: 1.3rem;
    color: #e53e3e;
    margin: 0 0 12px;
    font-weight: 700;
}
.esq-limite-card p {
    font-size: 0.9rem;
    color: #4a5568;
    line-height: 1.5;
    margin: 0;
}

/* ════════════════════════════════════════
   BLOQUEO DE IMPRESIÓN
   ════════════════════════════════════════ */

@media print {
    body { display: none !important; }
}
