/**
 * Plugin supriments — Estilos
 * Unitá Soluções Digitais — 2026
 */


:root {
    --sup-primary:  #1565C0;
    --sup-critical: #c62828;
}

/* ── Fix GLPI 10: writing-mode vertical herdado ──────────────────────────────── */
#sup-content,
#sup-content *,
#sup-content .card-body label,
#sup-content .card-body span,
#sup-content .card-body div,
#sup-content .form-label,
#sup-content .form-check-label,
.sup-ticket-wrap,
.sup-ticket-wrap * {
    writing-mode: horizontal-tb !important;
    transform: none !important;
    white-space: normal !important;
}

.sup-table th,
.sup-table td,
.sup-ticket-wrap th,
.sup-ticket-wrap td {
    writing-mode: horizontal-tb !important;
    transform: none !important;
    white-space: normal !important;
}

/* ── Tabela ─────────────────────────────────────────────────────────────────── */
.sup-table th,
.sup-table td {
    vertical-align: middle;
    white-space: normal;
}

/* ── Badge estoque crítico ───────────────────────────────────────────────────── */
.sup-badge-critical {
    background-color: var(--sup-critical) !important;
    color: #fff !important;
}

/* ── Linha crítica na tabela ─────────────────────────────────────────────────── */
.sup-row-critical {
    background-color: #fff5f5 !important;
}

.sup-row-critical td:first-child {
    border-left: 3px solid var(--sup-critical);
}

/* ── Dropdown de autocomplete ────────────────────────────────────────────────── */
.sup-dropdown {
    position: absolute;
    z-index: 1050;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 0 0 6px 6px;
    max-height: 240px;
    overflow-y: auto;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
}

.sup-dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: .875rem;
}

.sup-dropdown-item:hover {
    background-color: #f0f4ff;
}

.sup-dropdown-empty {
    padding: 10px 12px;
    color: #6c757d;
    font-size: .875rem;
}

/* ── Card de adição de item na aba do ticket ─────────────────────────────────── */
.sup-add-card {
    border: 1px dashed #1565C0;
    border-radius: 10px;
    background: #f8fbff;
}

/* ── Aba do ticket ───────────────────────────────────────────────────────────── */
.sup-ticket-tab {
    all: initial;
}

/* ── Posicionamento do dropdown relativo ao input ────────────────────────────── */
[id^="sup-add-"] .col-md-6 {
    position: relative;
}

/* ── Stat cards ── */
.sup-stat-icon {
    width: 44px; height: 44px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ── Table action buttons show on row hover ── */
.sup-table tbody tr .sup-actions { opacity: 0; transition: opacity .15s; }
.sup-table tbody tr:hover .sup-actions { opacity: 1; }

/* ── Page header ── */
.sup-page-header { margin-bottom: 1.5rem; }
.sup-page-header h2 { font-size: 1.4rem; font-weight: 600; margin-bottom: .25rem; }
.sup-page-header .subtitle { color: #6c757d; font-size: .875rem; }

/* ── Status pill badges custom ── */
.sup-badge-active   { background: #e8f5e9 !important; color: #2e7d32 !important; }
.sup-badge-inactive { background: #f5f5f5 !important; color: #757575 !important; }
.sup-badge-pending  { background: #e8eaf6 !important; color: #3949ab !important; }
.sup-badge-approved { background: #e3f2fd !important; color: #1565c0 !important; }
.sup-badge-separated{ background: #e8f5e9 !important; color: #2e7d32 !important; }
.sup-badge-partial  { background: #fff8e1 !important; color: #f57f17 !important; }
.sup-badge-cancelled{ background: #ffebee !important; color: #c62828 !important; }

/* ── Border-end for md+ breakpoint in stock info card ── */
@media (min-width: 768px) {
    .border-end-md { border-right: 1px solid #dee2e6 !important; }
}

/* ── Cabeçalhos de tabela ordenáveis ─────────────────────────────────────────── */
.sup-sortable-th {
    cursor: pointer;
    user-select: none;
    position: relative;
    white-space: nowrap;
}
.sup-sortable-th:hover { background-color: rgba(21, 101, 192, .06); }
.sup-sortable-th::after {
    content: "\f0dc";              /* fa-sort */
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", sans-serif;
    font-weight: 900;
    font-size: .7em;
    margin-left: .4em;
    opacity: .3;
}
.sup-sortable-th.sup-sort-asc::after  { content: "\f0de"; opacity: .9; }  /* fa-sort-up */
.sup-sortable-th.sup-sort-desc::after { content: "\f0dd"; opacity: .9; }  /* fa-sort-down */

/* ── Padronização de botões (altura/alinhamento) — chamado #7237 ─────────────── */
/* Uniformiza a altura e o alinhamento vertical de todos os botões do plugin,
   evitando a variação de altura entre botões com/sem ícone e entre .btn e .btn-sm
   nas barras de filtro e cabeçalhos. */
#sup-content .btn,
.sup-ticket-wrap .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    line-height: 1.2;
    vertical-align: middle;
}

#sup-content .btn-sm,
#sup-content .btn-group-sm > .btn,
.sup-ticket-wrap .btn-sm {
    min-height: 31px;
}

/* Botões-ícone (somente ícone) mantêm proporção quadrada consistente */
#sup-content .btn-icon.btn-sm,
.sup-ticket-wrap .btn-icon.btn-sm {
    min-width: 31px;
}

/* Alinha a barra de filtros: iguala a base dos campos e botões */
#sup-content form .form-control-sm,
#sup-content form .form-select-sm {
    min-height: 31px;
}

/* Busca de suprimento: seletor (select2) com a mesma largura do campo Categoria,
   evitando que volte a ficar mais estreito que os demais filtros. */
#sup-content form .sup-filter-item .select2-container {
    min-width: 220px;
}

/* ── Modais do plugin: garante writing-mode correto no conteúdo ──────────────── */
#supSeparationModal, #supSeparationModal *,
#supPurchaseModal,  #supPurchaseModal *,
#supConfirmModal,   #supConfirmModal * {
    writing-mode: horizontal-tb !important;
    transform: none !important;
}

