*{
    box-sizing:border-box;
}

html,
body{

    margin:0;
    padding:0;

    height:100%;
    font-family:Inter,sans-serif;

    background:var(--background);
    color:var(--text);

}

.erp-app{

    display:flex;

    min-height:100vh;

}

.erp-main{

    flex:1;

    display:flex;

    flex-direction:column;

    min-width:0;

}

.erp-page{

    flex:1;

    padding:30px;

    overflow:auto;

    background:var(--background);

}

@media(max-width:768px){

    .erp-page{
        padding:16px;
    }

}

.page{
    width:100%;
    display:block;
}



.toolbar{
    width:100%;
    margin-bottom:20px;
}

#productsTable{
    width:100%;
}

.products-table{
    width:100%;
    table-layout:auto;
}

.page-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    flex-wrap:wrap;
    gap:14px;
    margin-bottom:24px;
}

@media(max-width:576px){

    .page-header{
        flex-direction:column;
        align-items:stretch;
    }

    .page-header .erp-btn-primary{
        justify-content:center;
    }

}

.page-header h1{
    margin:0;
    font-size:28px;
    font-weight:700;
}

.page-header span{
    color:#fff;
}

.erp-btn-primary{
    display:flex;
    align-items:center;
    gap:8px;

    height:44px;

    padding:0 18px;

    border-radius:10px;

    font-weight:600;

    text-decoration:none;
}

.erp-card{
    background:var(--card);
    border:1px solid var(--border-alt);
    border-radius:14px;
    overflow:hidden;
}

/* Карта с падащи менюта във филтрите (напр. избор на категория в
   „Продукти"): абсолютно позиционираното меню излизаше извън ниска карта
   (малко резултати след търсене) и се режеше от overflow:hidden. Картата
   пуска преливането, а таблицата сама реже съдържанието си и държи
   заоблените долни ъгли. */
.erp-card--visible-overflow{
    overflow:visible;
}

.erp-card--visible-overflow > div[id$="Table"]{
    border-radius:0 0 14px 14px;
}

.confirm-modal{

    position:fixed;

    inset:0;

    background:rgba(0,0,0,.45);

    display:none;

    align-items:center;

    justify-content:center;

    padding:16px;

    z-index:99999;

}

.confirm-box{

    width:420px;

    max-width:100%;

    background:var(--card);

    color:var(--text);

    border-radius:12px;

    padding:24px;

    box-shadow:0 20px 60px rgba(0,0,0,.25);

}

.confirm-actions{

    display:flex;

    justify-content:flex-end;

    gap:12px;

    margin-top:24px;

}

/* Страница "Категории продукти" - влачене за подредба (product_categories.js).
   Линия преди/след реда = братя; оцветяване на реда = "вътре" (подкатегория). */
.pc-handle{
    display:inline-flex;
    align-items:center;
    cursor:grab;
    opacity:.45;
}
.pc-handle:hover{ opacity:.9; }
.pc-handle i,
.pc-handle svg{ width:16px; height:16px; }

#pcTable tr.pc-dragging{ opacity:.35; }

#pcTable tr.pc-drop-before > td{ box-shadow:inset 0 3px 0 0 var(--primary); }
#pcTable tr.pc-drop-after > td{ box-shadow:inset 0 -3px 0 0 var(--primary); }
#pcTable tr.pc-drop-inside > td{ background:rgba(201,165,90,.22); }
