body{
    background:#101010;
}

.navbar-brand{
    letter-spacing:.3px;
}

.card{
    border-radius:16px;
}

.card-img-top{
    background:#fff;
    object-fit:contain;
    height:220px;
}

.table td,
.table th{
    vertical-align:middle;
}

.btn{
    border-radius:10px;
}

main h3,
main h4{
    color:#fff;
}

.card h4,
.card h5{
    color:#111;
}

.loader-overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.78);
    z-index:9999;
    display:flex;
    align-items:center;
    justify-content:center;
}

.loader-box{
    background:#fff;
    color:#111;
    width:min(430px,90%);
    padding:30px;
    border-radius:18px;
    text-align:center;
    box-shadow:0 20px 60px rgba(0,0,0,.35);
}

/* EDITOR */

.editor-body{
    overflow:hidden;
    background:#101010;
}

.editor-shell{
    display:grid;
    grid-template-columns:360px minmax(0, 1fr);
    width:100vw;
    height:100vh;
    overflow:hidden;
    background:#101010;
}

.editor-sidebar-fixed{
    width:360px;
    height:100vh;
    overflow-y:auto;
    background:#191919;
    border-right:1px solid rgba(255,255,255,.08);
    padding:14px;
}

.sidebar-title{
    color:#fff;
    margin-bottom:14px;
}

.sidebar-title h5{
    margin:0;
    font-weight:700;
}

.sidebar-title small{
    color:#bdbdbd;
}

.side-card{
    background:#252525;
    border:1px solid rgba(255,255,255,.08);
    border-radius:14px;
    padding:14px;
    margin-bottom:14px;
}

.side-card h6{
    color:#4da3ff;
    font-weight:800;
    text-transform:uppercase;
    margin-bottom:14px;
}

.side-card label,
.side-card p{
    color:#f2f2f2;
}

.editor-workspace{
    height:100vh;
    overflow:hidden;
    padding:14px;
    display:flex;
    flex-direction:column;
}

.editor-header{
    color:#fff;
    background:#151515;
    border:1px solid rgba(255,255,255,.08);
    border-radius:14px;
    padding:12px 16px;
    margin-bottom:10px;
}

.editor-header h4{
    margin:0;
    font-size:20px;
    font-weight:700;
}

.editor-header p{
    margin:4px 0 0;
    color:#cfcfcf;
}

.editor-tip{
    background:#17345f;
    color:#fff;
    border:1px solid #2f64ad;
    padding:10px 14px;
    border-radius:10px;
    margin-bottom:10px;
}

.canvas-scroll-area{
    flex:1;
    overflow:auto;
    background:#181818;
    border-radius:16px;
    padding:24px;
    text-align:center;
}

#editorCanvas{
    background:#fff;
    display:inline-block;
    box-shadow:0 0 0 1px rgba(255,255,255,.18), 0 15px 55px rgba(0,0,0,.45);
    cursor:crosshair;
    touch-action:none;
}

.step-btn{
    min-width:44px;
}

@media(max-width: 900px){
    .editor-body{
        overflow:auto;
    }

    .editor-shell{
        display:block;
        height:auto;
        overflow:visible;
    }

    .editor-sidebar-fixed{
        width:100%;
        height:auto;
        overflow:visible;
    }

    .editor-workspace{
        height:auto;
    }

    .canvas-scroll-area{
        height:75vh;
    }
}



/* HOME NUEVO */

.home-body{
    background:#eef2f7;
}

.hero-section{
    background:
        radial-gradient(circle at top right, rgba(13,110,253,.35), transparent 35%),
        linear-gradient(135deg, #101827 0%, #18233a 55%, #0f172a 100%);
    padding:70px 0;
}

.hero-card{
    background:rgba(255,255,255,.08);
    border:1px solid rgba(255,255,255,.15);
    border-radius:22px;
    padding:26px;
    color:#fff;
    box-shadow:0 25px 80px rgba(0,0,0,.25);
}

.step-pill{
    background:rgba(255,255,255,.12);
    border:1px solid rgba(255,255,255,.12);
    padding:12px 14px;
    border-radius:14px;
    margin-top:10px;
}

/* SELECCION DE LAMINAS */

.selection-header{
    background:linear-gradient(135deg, #111827, #1d4ed8);
    border-radius:22px;
    padding:24px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:20px;
    box-shadow:0 20px 60px rgba(0,0,0,.18);
}

.selection-counter{
    background:#fff;
    color:#111;
    padding:14px 20px;
    border-radius:18px;
    font-weight:800;
    min-width:160px;
    text-align:center;
}

.selection-counter span{
    color:#198754;
    font-size:30px;
    line-height:1;
}

.laminas-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(150px, 1fr));
    gap:18px;
}

.lamina-card{
    position:relative;
    background:#fff;
    border-radius:18px;
    padding:10px;
    cursor:pointer;
    box-shadow:0 8px 24px rgba(0,0,0,.12);
    border:3px solid transparent;
    transition:.18s ease;
}

.lamina-card:hover{
    transform:translateY(-3px);
    box-shadow:0 12px 32px rgba(0,0,0,.18);
}

.lamina-card.selected{
    border-color:#198754;
    background:#ecfff4;
}

.lamina-card img{
    width:100%;
    height:190px;
    object-fit:contain;
    background:#f8f9fa;
    border-radius:12px;
}

.lamina-info{
    margin-top:8px;
    text-align:center;
}

.lamina-info strong{
    display:block;
    font-size:13px;
}

.lamina-info small{
    color:#666;
    font-size:11px;
    word-break:break-all;
}

.lamina-check{
    position:absolute;
    top:8px;
    right:8px;
    width:28px;
    height:28px;
    border-radius:999px;
    background:#198754;
    color:#fff;
    display:none;
    align-items:center;
    justify-content:center;
    font-weight:bold;
    z-index:2;
}

.lamina-card.selected .lamina-check{
    display:flex;
}



/* FIX PASO 13: EDITOR SIEMPRE LATERAL */

body.editor-body{
    margin:0 !important;
    padding:0 !important;
    overflow:hidden !important;
    background:#101010 !important;
}

.editor-shell-force{
    width:100vw !important;
    height:100vh !important;
    display:flex !important;
    flex-direction:row !important;
    align-items:stretch !important;
    overflow:hidden !important;
    background:#101010 !important;
}

.editor-sidebar-left{
    width:360px !important;
    min-width:360px !important;
    max-width:360px !important;
    height:100vh !important;
    overflow-y:auto !important;
    background:#191919 !important;
    border-right:1px solid rgba(255,255,255,.10) !important;
    padding:14px !important;
    box-sizing:border-box !important;
}

.editor-canvas-right{
    flex:1 !important;
    min-width:0 !important;
    height:100vh !important;
    overflow:hidden !important;
    padding:14px !important;
    box-sizing:border-box !important;
    display:flex !important;
    flex-direction:column !important;
}

.canvas-scroll-area{
    flex:1 !important;
    min-height:0 !important;
    overflow:auto !important;
    background:#181818 !important;
    border-radius:16px !important;
    padding:24px !important;
    text-align:center !important;
}

.side-card{
    background:#252525 !important;
    border:1px solid rgba(255,255,255,.08) !important;
    border-radius:14px !important;
    padding:14px !important;
    margin-bottom:14px !important;
}

.side-card h6{
    color:#4da3ff !important;
    font-weight:800 !important;
    text-transform:uppercase !important;
    margin-bottom:14px !important;
}

.side-card label,
.side-card p,
.sidebar-title{
    color:#f2f2f2 !important;
}

.editor-header{
    color:#fff !important;
    background:#151515 !important;
    border:1px solid rgba(255,255,255,.08) !important;
    border-radius:14px !important;
    padding:12px 16px !important;
    margin-bottom:10px !important;
}

.editor-header h4{
    margin:0 !important;
    font-size:20px !important;
    font-weight:700 !important;
    color:#fff !important;
}

.editor-header p{
    margin:4px 0 0 !important;
    color:#cfcfcf !important;
}

.editor-tip{
    background:#17345f !important;
    color:#fff !important;
    border:1px solid #2f64ad !important;
    padding:10px 14px !important;
    border-radius:10px !important;
    margin-bottom:10px !important;
}

#editorCanvas{
    background:#fff !important;
    display:inline-block !important;
    box-shadow:0 0 0 1px rgba(255,255,255,.18), 0 15px 55px rgba(0,0,0,.45) !important;
    cursor:crosshair !important;
    touch-action:none !important;
}

@media(max-width: 760px){
    .editor-shell-force{
        display:block !important;
        overflow:auto !important;
        height:auto !important;
    }

    .editor-sidebar-left{
        width:100% !important;
        max-width:100% !important;
        min-width:100% !important;
        height:auto !important;
    }

    .editor-canvas-right{
        height:80vh !important;
    }
}



/* PASO 14 - FIX DEFINITIVO EDITOR LATERAL */

html,
body.editor-page-fixed{
    width:100% !important;
    height:100% !important;
    margin:0 !important;
    padding:0 !important;
    overflow:hidden !important;
    background:#101010 !important;
}

.fixed-editor-sidebar{
    position:fixed !important;
    left:0 !important;
    top:0 !important;
    bottom:0 !important;
    width:360px !important;
    min-width:360px !important;
    max-width:360px !important;
    height:100vh !important;
    overflow-y:auto !important;
    background:#191919 !important;
    border-right:1px solid rgba(255,255,255,.12) !important;
    padding:14px !important;
    box-sizing:border-box !important;
    z-index:20 !important;
}

.fixed-editor-main{
    position:fixed !important;
    left:360px !important;
    top:0 !important;
    right:0 !important;
    bottom:0 !important;
    height:100vh !important;
    overflow:hidden !important;
    padding:14px !important;
    box-sizing:border-box !important;
    background:#101010 !important;
    display:flex !important;
    flex-direction:column !important;
    z-index:10 !important;
}

.fixed-canvas-scroll{
    flex:1 !important;
    min-height:0 !important;
    width:100% !important;
    overflow:auto !important;
    background:#181818 !important;
    border-radius:16px !important;
    padding:24px !important;
    text-align:center !important;
    box-sizing:border-box !important;
}

.sidebar-title{
    color:#fff !important;
    margin-bottom:14px !important;
}

.sidebar-title h5{
    margin:0 !important;
    font-weight:800 !important;
    color:#fff !important;
}

.sidebar-title small{
    color:#cfcfcf !important;
}

.side-card{
    background:#252525 !important;
    border:1px solid rgba(255,255,255,.08) !important;
    border-radius:14px !important;
    padding:14px !important;
    margin-bottom:14px !important;
}

.side-card h6{
    color:#4da3ff !important;
    font-weight:800 !important;
    text-transform:uppercase !important;
    margin-bottom:14px !important;
}

.side-card label,
.side-card p{
    color:#f2f2f2 !important;
}

.fixed-editor-header{
    color:#fff !important;
    background:#151515 !important;
    border:1px solid rgba(255,255,255,.08) !important;
    border-radius:14px !important;
    padding:12px 16px !important;
    margin-bottom:10px !important;
    flex:0 0 auto !important;
}

.fixed-editor-header h4{
    margin:0 !important;
    font-size:20px !important;
    font-weight:700 !important;
    color:#fff !important;
}

.fixed-editor-header p{
    margin:4px 0 0 !important;
    color:#cfcfcf !important;
}

.fixed-editor-tip{
    background:#17345f !important;
    color:#fff !important;
    border:1px solid #2f64ad !important;
    padding:10px 14px !important;
    border-radius:10px !important;
    margin-bottom:10px !important;
    flex:0 0 auto !important;
}

#editorCanvas{
    background:#fff !important;
    display:inline-block !important;
    box-shadow:0 0 0 1px rgba(255,255,255,.18), 0 15px 55px rgba(0,0,0,.45) !important;
    cursor:crosshair !important;
    touch-action:none !important;
}

/* Anula reglas móviles anteriores que ponían el menú arriba */
@media(max-width: 99999px){
    body.editor-page-fixed .fixed-editor-sidebar{
        position:fixed !important;
        left:0 !important;
        top:0 !important;
        bottom:0 !important;
        width:360px !important;
        min-width:360px !important;
        max-width:360px !important;
        height:100vh !important;
    }

    body.editor-page-fixed .fixed-editor-main{
        position:fixed !important;
        left:360px !important;
        top:0 !important;
        right:0 !important;
        bottom:0 !important;
        height:100vh !important;
    }
}


/* PASO 17 - GALERIA PARA ELIMINAR RECORTES */

.gallery-header{
    background:linear-gradient(135deg, #111827, #334155);
    border-radius:22px;
    padding:24px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:20px;
    box-shadow:0 20px 60px rgba(0,0,0,.18);
}

.gallery-counter{
    background:#fff;
    color:#111;
    padding:14px 20px;
    border-radius:18px;
    font-weight:800;
    min-width:150px;
    text-align:center;
}

.gallery-counter span{
    color:#0d6efd;
    font-size:30px;
    line-height:1;
}

.selected-delete-box{
    background:#f8f9fa;
    border:1px solid #dee2e6;
    border-radius:12px;
    padding:10px 14px;
}

.delete-gallery-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(150px, 1fr));
    gap:18px;
}

.delete-crop-card{
    position:relative;
    background:#fff;
    border-radius:18px;
    padding:10px;
    cursor:pointer;
    box-shadow:0 8px 24px rgba(0,0,0,.12);
    border:3px solid transparent;
    transition:.18s ease;
}

.delete-crop-card:hover{
    transform:translateY(-3px);
    box-shadow:0 12px 32px rgba(0,0,0,.18);
}

.delete-crop-card.marked-delete{
    border-color:#dc3545;
    background:#fff0f1;
}

.delete-crop-card img{
    width:100%;
    height:190px;
    object-fit:contain;
    background:#f8f9fa;
    border-radius:12px;
}

.delete-crop-info{
    margin-top:8px;
    text-align:center;
}

.delete-crop-info small{
    color:#555;
    font-size:11px;
    word-break:break-all;
}

.delete-check{
    position:absolute;
    top:8px;
    right:8px;
    background:#dc3545;
    color:#fff;
    border-radius:999px;
    padding:5px 10px;
    font-size:12px;
    font-weight:bold;
    display:none;
    z-index:2;
}

.delete-crop-card.marked-delete .delete-check{
    display:block;
}


/* PASO 18 - GALERÍA COMO WORKSPACE */

.gallery-workspace-body{
    margin:0;
    background:#101010;
    overflow:hidden;
}

.gallery-workspace{
    width:100vw;
    height:100vh;
    display:grid;
    grid-template-columns:320px minmax(0, 1fr);
    background:#101010;
}

.gallery-sidebar{
    height:100vh;
    overflow-y:auto;
    background:#191919;
    border-right:1px solid rgba(255,255,255,.10);
    padding:16px;
    box-sizing:border-box;
}

.gallery-brand{
    color:#fff;
    margin-bottom:18px;
}

.gallery-brand h4{
    font-weight:800;
    margin:0;
}

.gallery-brand small{
    color:#cfcfcf;
}

.gallery-side-card{
    background:#252525;
    border:1px solid rgba(255,255,255,.08);
    border-radius:16px;
    padding:14px;
    margin-bottom:14px;
}

.gallery-side-card h6{
    color:#4da3ff;
    font-weight:800;
    text-transform:uppercase;
    margin-bottom:12px;
}

.mini-stat{
    background:#111827;
    color:#fff;
    border-radius:14px;
    padding:14px;
    text-align:center;
}

.mini-stat span{
    display:block;
    font-size:34px;
    font-weight:900;
    color:#22c55e;
    line-height:1;
}

.mini-stat small{
    color:#d1d5db;
}

.gallery-help{
    color:#cfcfcf;
    background:#111;
    border-radius:12px;
    padding:12px;
    font-size:13px;
}

.gallery-main{
    height:100vh;
    overflow:hidden;
    padding:16px;
    box-sizing:border-box;
    display:flex;
    flex-direction:column;
    min-width:0;
}

.gallery-topbar{
    background:#151515;
    border:1px solid rgba(255,255,255,.08);
    border-radius:16px;
    padding:14px 16px;
    margin-bottom:14px;
    color:#fff;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:14px;
    flex:0 0 auto;
}

.gallery-topbar h3{
    color:#fff;
    margin:0;
    font-weight:800;
}

.gallery-topbar p{
    margin:4px 0 0;
    color:#cfcfcf;
}

.gallery-actions-top{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}

.gallery-grid-compact{
    flex:1;
    min-height:0;
    overflow:auto;
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(118px, 1fr));
    gap:12px;
    align-content:start;
    padding:4px 4px 30px;
}

.compact-card{
    background:#fff;
    border-radius:14px;
    padding:7px;
    cursor:pointer;
    box-shadow:0 6px 16px rgba(0,0,0,.25);
    border:3px solid transparent;
    transition:.15s ease;
    position:relative;
}

.compact-card:hover{
    transform:translateY(-2px);
}

.compact-card.marked-delete{
    border-color:#dc3545;
    background:#fff0f1;
}

.thumb-box{
    width:100%;
    height:145px;
    background:#f8f9fa;
    border-radius:10px;
    overflow:hidden;
    display:flex;
    align-items:center;
    justify-content:center;
}

.thumb-box img{
    width:100%;
    height:100%;
    object-fit:contain;
}

.delete-crop-info{
    margin-top:5px;
    text-align:center;
    min-height:30px;
}

.delete-crop-info small{
    color:#333;
    font-size:10px;
    line-height:1.15;
    word-break:break-all;
}

.delete-check{
    position:absolute;
    top:6px;
    right:6px;
    background:#dc3545;
    color:#fff;
    border-radius:999px;
    padding:4px 8px;
    font-size:11px;
    font-weight:bold;
    display:none;
    z-index:5;
}

.compact-card.marked-delete .delete-check{
    display:block;
}

.selected-delete-box{
    background:#f8f9fa;
    border:1px solid #dee2e6;
    border-radius:12px;
    padding:10px 14px;
}

@media(max-width:900px){
    .gallery-workspace-body{
        overflow:auto;
    }

    .gallery-workspace{
        display:block;
        height:auto;
    }

    .gallery-sidebar{
        height:auto;
    }

    .gallery-main{
        height:auto;
    }

    .gallery-grid-compact{
        overflow:visible;
    }

    .gallery-topbar{
        flex-direction:column;
        align-items:flex-start;
    }
}


.lamina-card.active-repeat{
    box-shadow:0 0 0 4px rgba(255,193,7,.45), 0 6px 14px rgba(0,0,0,.35) !important;
}

.lamina-card.active-repeat{box-shadow:0 0 0 4px rgba(255,193,7,.45),0 6px 14px rgba(0,0,0,.35)!important;}
