/**
 * 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 */

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

