/* ============================================
   CMMS Industrial - Estilizacao Almoxarifado Inteligente
   Design Industrial Quadrado
   OTIMIZADO: Layout responsivo + Desktop melhorado + Componentes completos
   CORRECAO MOBILE: Botoes organizados (2/linha - largura consistente) + Tabs (3/linha)
   ============================================ */

:root {
    --almox-bg-primary: #0f172a;
    --almox-bg-secondary: #1e293b;
    --almox-bg-tertiary: #334155;
    --almox-bg-card: #1e293b;
    --almox-bg-input: #0f172a;
    --almox-bg-hover: rgba(255, 255, 255, 0.05);
    --almox-text-primary: #f8fafc;
    --almox-text-secondary: #cbd5e1;
    --almox-text-muted: #94a3b8;
    --almox-border: rgba(255, 255, 255, 0.1);
    --almox-success: #10b981;
    --almox-danger: #ef4444;
    --almox-warning: #f59e0b;
    --almox-info: #3b82f6;
    --almox-purple: #8b5cf6;
    --almox-radius-sm: 0px;
    --almox-radius-md: 0px;
    --almox-radius-lg: 0px;
    --almox-transition: 0.2s ease;
    --almox-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --almox-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --almox-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* ========== LAYOUT PRINCIPAL ========== */
.almoxarifado-module {
    padding: 0;
    background: transparent;
    color: var(--almox-text-primary);
    font-family: 'Inter', sans-serif;
}

/* ========== HEADER ========== */
.almox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: 16px 20px;
    background: var(--almox-bg-card);
    margin-bottom: 20px;
    border: 1px solid var(--almox-border);
    border-left: 5px solid var(--almox-success);
    gap: 16px;
}

.almox-title {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.almox-title i {
    font-size: 32px;
    color: var(--almox-success);
}

.almox-title h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--almox-text-primary);
}

.almox-title .subtitle {
    display: block;
    font-size: 12px;
    color: var(--almox-text-muted);
    font-weight: 400;
    margin-top: 4px;
}

.almox-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.almox-actions button {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--almox-transition);
    white-space: nowrap;
    border: none;
    cursor: pointer;
}

.almox-actions button:active {
    transform: scale(0.97);
}

/* ========== BOTOES PADRAO ========== */
.btn-primary {
    background: var(--almox-success);
    color: white;
}
.btn-primary:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: var(--almox-shadow-md);
}

.btn-secondary {
    background: transparent;
    color: var(--almox-success);
    border: 1px solid var(--almox-success);
}
.btn-secondary:hover {
    background: rgba(16, 185, 129, 0.1);
    transform: translateY(-2px);
}

.btn-info {
    background: var(--almox-info);
    color: white;
}
.btn-info:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--almox-danger);
    color: white;
}
.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-warning {
    background: var(--almox-warning);
    color: white;
}
.btn-warning:hover {
    background: #d97706;
    transform: translateY(-2px);
}

.btn-icon {
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--almox-border);
    color: var(--almox-text-secondary);
    cursor: pointer;
    transition: all var(--almox-transition);
}
.btn-icon:hover {
    background: var(--almox-bg-hover);
    color: var(--almox-success);
    transform: translateY(-2px);
}

/* ========== BOTAO DELETE ESPECIFICO ========== */
.btn-delete-item {
    background: rgba(239, 68, 68, 0.1);
    color: var(--almox-danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 6px 12px;
    cursor: pointer;
    transition: all var(--almox-transition);
}
.btn-delete-item:hover {
    background: var(--almox-danger);
    color: white;
    transform: translateY(-2px);
}

/* ========== BOTAO AJUSTE ESTOQUE ========== */
.btn-adjust-stock {
    background: rgba(59, 130, 246, 0.1);
    color: var(--almox-info);
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 6px 12px;
    cursor: pointer;
    transition: all var(--almox-transition);
}
.btn-adjust-stock:hover {
    background: var(--almox-info);
    color: white;
    transform: translateY(-2px);
}

/* ========== BOTOES ACESSIBILIDADE ========== */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ========== ABAS ========== */
.almox-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--almox-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    color: var(--almox-text-muted);
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--almox-transition);
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.tab-btn:hover {
    color: var(--almox-success);
    background: rgba(16, 185, 129, 0.05);
}

.tab-btn.active {
    color: var(--almox-success);
    border-bottom-color: var(--almox-success);
}

.tab-btn i {
    font-size: 16px;
}

/* ========== CONTEUDO DAS ABAS ========== */
.almox-content {
    padding: 0;
    background: transparent;
}

.tab-content {
    display: none;
    animation: almoxFadeIn var(--almox-transition) ease;
}

.tab-content.active {
    display: block;
}

@keyframes almoxFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== KPIs DASHBOARD ========== */
.almox-dashboard {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.almox-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.kpi-card {
    background: var(--almox-bg-card);
    padding: 18px 16px;
    border: 1px solid var(--almox-border);
    border-left: 5px solid var(--almox-success);
    transition: all var(--almox-transition);
    display: flex;
    flex-direction: column;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--almox-shadow-md);
}

.kpi-card.alert {
    border-left-color: var(--almox-danger);
}

.kpi-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.kpi-header i {
    font-size: 22px;
    color: var(--almox-success);
}

.kpi-header.alert i {
    color: var(--almox-danger);
}

.kpi-title {
    font-size: 13px;
    color: var(--almox-text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--almox-text-primary);
    margin: 8px 0;
    line-height: 1.2;
}

.kpi-detail {
    font-size: 11px;
    color: var(--almox-text-secondary);
}

/* ========== ALERTAS ========== */
.almox-alerts {
    background: var(--almox-bg-card);
    padding: 20px;
    border: 1px solid var(--almox-border);
    border-left: 5px solid var(--almox-warning);
}

.almox-alerts h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: var(--almox-warning);
    display: flex;
    align-items: center;
    gap: 8px;
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alert-item {
    padding: 14px 16px;
    background: rgba(245, 158, 11, 0.1);
    border-left: 3px solid var(--almox-warning);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.alert-content {
    flex: 1;
}

.alert-texto {
    font-size: 14px;
    color: var(--almox-text-primary);
    margin: 0;
    font-weight: 500;
}

.alert-prioridade {
    font-size: 11px;
    color: var(--almox-warning);
    font-weight: 600;
    text-transform: uppercase;
}

/* ========== GRAFICOS ========== */
.almox-chart {
    background: var(--almox-bg-card);
    padding: 20px;
    border: 1px solid var(--almox-border);
    margin-bottom: 20px;
}

.almox-chart h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: var(--almox-success);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========== ITENS CRITICOS ========== */
.almox-critical {
    background: var(--almox-bg-card);
    padding: 20px;
    border: 1px solid var(--almox-border);
}

.almox-critical h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: var(--almox-danger);
    display: flex;
    align-items: center;
    gap: 8px;
}

.itens-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item-critico {
    padding: 14px 16px;
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid var(--almox-danger);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.item-critico-info {
    flex: 1;
    font-size: 13px;
}

.item-critico-info strong {
    color: var(--almox-text-primary);
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
}

.item-critico-acao {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.item-critico-acao button {
    padding: 8px 16px;
    font-size: 12px;
    border: none;
    cursor: pointer;
    transition: all var(--almox-transition);
}

/* ========== MATRIZ ABC/XYZ ========== */
.almox-matriz {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.matriz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
}

.matriz-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--almox-success);
    display: flex;
    align-items: center;
    gap: 8px;
}

.matriz-container {
    overflow-x: auto;
    background: var(--almox-bg-card);
    padding: 16px;
    border: 1px solid var(--almox-border);
}

.matriz-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 500px;
}

.matriz-table thead {
    background: var(--almox-bg-tertiary);
}

.matriz-table th {
    padding: 12px 14px;
    text-align: left;
    color: var(--almox-success);
    font-weight: 600;
    border-bottom: 2px solid var(--almox-border);
}

.matriz-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--almox-border);
    color: var(--almox-text-primary);
}

.matriz-table tbody tr:hover {
    background: var(--almox-bg-hover);
}

/* Badges para Matriz */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-ax, .badge-AX { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.badge-ay, .badge-AY { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.badge-az, .badge-AZ { background: rgba(239, 68, 68, 0.3); color: #ef4444; font-weight: bold; }
.badge-bx, .badge-BX { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.badge-by, .badge-BY { background: rgba(139, 92, 246, 0.2); color: #8b5cf6; }
.badge-bz, .badge-BZ { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.badge-cx, .badge-CX { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.badge-cy, .badge-CY { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.badge-cz, .badge-CZ { background: rgba(148, 163, 184, 0.2); color: #94a3b8; }

/* Badges para Classes ABC */
.badge-a, .badge-A {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}
.badge-b, .badge-B {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}
.badge-c, .badge-C {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

/* Badges para Classes XYZ */
.badge-x, .badge-X {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}
.badge-y, .badge-Y {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
}
.badge-z, .badge-Z {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Legenda */
.matriz-legenda {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.legenda-grupo {
    background: var(--almox-bg-card);
    padding: 16px;
    border: 1px solid var(--almox-border);
}

.legenda-grupo h4 {
    margin: 0 0 12px 0;
    color: var(--almox-success);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.legenda-item {
    padding: 8px 12px;
    margin-bottom: 6px;
    background: rgba(16, 185, 129, 0.05);
    border-left: 3px solid var(--almox-success);
    font-size: 12px;
    color: var(--almox-text-primary);
}

.legenda-item strong {
    color: var(--almox-success);
}

.legenda-item.az {
    border-left-color: var(--almox-danger);
    background: rgba(239, 68, 68, 0.05);
}

.legenda-item.bx,
.legenda-item.by {
    border-left-color: var(--almox-warning);
    background: rgba(245, 158, 11, 0.05);
}

.legenda-item.cx {
    border-left-color: var(--almox-info);
    background: rgba(59, 130, 246, 0.05);
}

.legenda-item.cz {
    border-left-color: var(--almox-text-muted);
    background: rgba(148, 163, 184, 0.05);
}

/* ========== GESTAO DE ESTOQUE ========== */
.almox-gestao {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.gestao-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gestao-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--almox-success);
    display: flex;
    align-items: center;
    gap: 8px;
}

.filtros-gestao {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.filtros-gestao .form-control {
    min-width: 160px;
}

.gestao-tabela-container {
    overflow-x: auto;
    background: var(--almox-bg-card);
    padding: 16px;
    border: 1px solid var(--almox-border);
}

.gestao-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    min-width: 800px;
}

.gestao-table thead {
    background: var(--almox-bg-tertiary);
}

.gestao-table th {
    padding: 12px 14px;
    text-align: left;
    color: var(--almox-success);
    font-weight: 600;
    border-bottom: 2px solid var(--almox-border);
}

.gestao-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--almox-border);
    color: var(--almox-text-primary);
}

.gestao-table tbody tr:hover {
    background: var(--almox-bg-hover);
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-critical {
    background: rgba(239, 68, 68, 0.2);
    color: var(--almox-danger);
}
.status-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--almox-warning);
}
.status-ideal {
    background: rgba(16, 185, 129, 0.2);
    color: var(--almox-success);
}
.status-excesso {
    background: rgba(59, 130, 246, 0.2);
    color: var(--almox-info);
}

/* ========== SUGESTOES DE COMPRA ========== */
.almox-compras {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.compras-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.compras-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--almox-success);
    display: flex;
    align-items: center;
    gap: 8px;
}

.compras-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.compras-filtros .form-control {
    min-width: 180px;
}

.compras-lista {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sugestao-compra {
    background: var(--almox-bg-card);
    padding: 16px 20px;
    border-left: 5px solid var(--almox-success);
    border: 1px solid var(--almox-border);
    transition: all var(--almox-transition);
}

.sugestao-compra:hover {
    transform: translateX(4px);
    box-shadow: var(--almox-shadow-sm);
}

.sugestao-compra.urgente {
    border-left-color: var(--almox-danger);
}

.sugestao-compra.alta {
    border-left-color: var(--almox-warning);
}

.sugestao-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sugestao-item strong {
    color: var(--almox-text-primary);
    font-size: 14px;
}

.sugestao-item p {
    margin: 0;
    font-size: 12px;
    color: var(--almox-text-muted);
}

.sugestao-acoes {
    display: flex;
    gap: 8px;
}

.sugestao-acoes button {
    padding: 8px 16px;
    font-size: 12px;
    border: none;
    cursor: pointer;
    transition: all var(--almox-transition);
}

.sugestao-acoes button:active {
    transform: scale(0.96);
}

/* Input quantidade sugerida */
.qtd-sugerida-input {
    width: 80px;
    padding: 8px;
    text-align: center;
    background: var(--almox-bg-input);
    border: 1px solid var(--almox-border);
    color: var(--almox-text-primary);
}

.qtd-sugerida-input:focus {
    border-color: var(--almox-success);
    outline: none;
}

/* ========== RASTREABILIDADE ========== */
.almox-rastreabilidade {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rastreabilidade-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rastreabilidade-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--almox-success);
    display: flex;
    align-items: center;
    gap: 8px;
}

.rastreabilidade-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.rastreabilidade-filtros .form-control {
    min-width: 160px;
}

.rastreabilidade-tabela {
    overflow-x: auto;
    background: var(--almox-bg-card);
    padding: 16px;
    border: 1px solid var(--almox-border);
}

.rastreabilidade-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    min-width: 900px;
}

.rastreabilidade-table thead {
    background: var(--almox-bg-tertiary);
}

.rastreabilidade-table th {
    padding: 12px 14px;
    text-align: left;
    color: var(--almox-success);
    font-weight: 600;
    border-bottom: 2px solid var(--almox-border);
    white-space: nowrap;
}

.rastreabilidade-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--almox-border);
    color: var(--almox-text-primary);
}

.rastreabilidade-table tbody tr:hover {
    background: var(--almox-bg-hover);
}

.tipo-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.tipo-entrada {
    background: rgba(16, 185, 129, 0.2);
    color: var(--almox-success);
}
.tipo-saida {
    background: rgba(239, 68, 68, 0.2);
    color: var(--almox-danger);
}
.tipo-ajuste {
    background: rgba(245, 158, 11, 0.2);
    color: var(--almox-warning);
}
.tipo-reserva {
    background: rgba(139, 92, 246, 0.2);
    color: var(--almox-purple);
}

/* ========== RESERVAS ========== */
.almox-reservas {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.reservas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.reservas-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--almox-success);
    display: flex;
    align-items: center;
    gap: 8px;
}

.reservas-tabela-container {
    overflow-x: auto;
    background: var(--almox-bg-card);
    padding: 16px;
    border: 1px solid var(--almox-border);
}

.reservas-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    min-width: 700px;
}

.reservas-table thead {
    background: var(--almox-bg-tertiary);
}

.reservas-table th {
    padding: 12px 14px;
    text-align: left;
    color: var(--almox-success);
    font-weight: 600;
    border-bottom: 2px solid var(--almox-border);
}

.reservas-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--almox-border);
    color: var(--almox-text-primary);
}

/* ========== FORM CONTROLES ========== */
.form-control {
    background: var(--almox-bg-input);
    color: var(--almox-text-primary);
    border: 1px solid var(--almox-border);
    padding: 10px 14px;
    font-size: 13px;
}

.form-control:focus {
    border-color: var(--almox-success);
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-control::placeholder {
    color: var(--almox-text-muted);
    opacity: 0.5;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--almox-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.toast-container {
    z-index: 9999;
}

.modal-container {
    background: var(--almox-bg-card);
    border: 1px solid var(--almox-border);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: almoxModalIn 0.2s ease;
}

@keyframes almoxModalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--almox-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--almox-bg-secondary);
}

.modal-header h2, .modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--almox-text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--almox-text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    transition: color var(--almox-transition);
}

.modal-close:hover {
    color: var(--almox-danger);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--almox-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--almox-bg-secondary);
}

/* ========== INFO BOX ========== */
.info-box {
    background: var(--almox-bg-secondary);
    padding: 15px;
    border: 1px solid var(--almox-border);
}

.info-box p {
    margin: 5px 0;
    font-size: 13px;
}

/* ========== ESTADOS ========== */
.loading {
    text-align: center;
    padding: 60px;
    color: var(--almox-text-muted);
}

.empty-state {
    text-align: center;
    padding: 60px;
    color: var(--almox-text-secondary);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.text-muted {
    color: var(--almox-text-muted);
    font-size: 11px;
}

/* ========== SCROLLBARS PERSONALIZADAS ========== */
.gestao-tabela-container::-webkit-scrollbar,
.rastreabilidade-tabela::-webkit-scrollbar,
.matriz-container::-webkit-scrollbar,
.reservas-tabela-container::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.gestao-tabela-container::-webkit-scrollbar-track,
.rastreabilidade-tabela::-webkit-scrollbar-track,
.matriz-container::-webkit-scrollbar-track,
.reservas-tabela-container::-webkit-scrollbar-track {
    background: var(--almox-bg-tertiary);
}

.gestao-tabela-container::-webkit-scrollbar-thumb,
.rastreabilidade-tabela::-webkit-scrollbar-thumb,
.matriz-container::-webkit-scrollbar-thumb,
.reservas-tabela-container::-webkit-scrollbar-thumb {
    background: var(--almox-success);
}

.gestao-tabela-container::-webkit-scrollbar-thumb:hover,
.rastreabilidade-tabela::-webkit-scrollbar-thumb:hover,
.matriz-container::-webkit-scrollbar-thumb:hover,
.reservas-tabela-container::-webkit-scrollbar-thumb:hover {
    background: #059669;
}

/* ========== TOOLTIPS ========== */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: var(--almox-bg-card);
    color: var(--almox-text-primary);
    font-size: 11px;
    white-space: nowrap;
    border: 1px solid var(--almox-border);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--almox-transition);
    z-index: 1000;
}

[data-tooltip]:hover:before {
    opacity: 1;
}

/* ========== RESPONSIVO ========== */

/* Desktop (> 1200px) */
@media (min-width: 1201px) {
    .almox-kpis { grid-template-columns: repeat(4, 1fr); }
}

/* Desktop (992px - 1200px) */
@media (min-width: 992px) and (max-width: 1200px) {
    .almox-kpis { grid-template-columns: repeat(3, 1fr); }
}

/* Tablet (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .almox-kpis { grid-template-columns: repeat(2, 1fr); }
    .sugestao-compra { grid-template-columns: repeat(2, 1fr); }
    .sugestao-compra .sugestao-acoes { grid-column: span 2; }
    .filtros-gestao { flex-wrap: wrap; }
    .form-row { grid-template-columns: 1fr; }
}

/* ========== MOBILE (< 768px) - BOTOES E TABS CORRIGIDOS ========== */
@media (max-width: 767px) {
    .almox-header {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
        align-items: stretch;
    }
    
    .almox-title {
        text-align: center;
        justify-content: center;
        flex-direction: column;
        gap: 8px;
    }
    
    /* BOTOES SUPERIORES: 2 por linha - LARGURA CONSISTENTE */
    .almox-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .almox-actions button {
        width: 100%;
        min-width: 0;
        max-width: none;
        font-size: 12px;
        padding: 12px 8px;
        justify-content: center;
        white-space: normal;
        word-break: break-word;
        text-align: center;
        margin: 0;
        box-sizing: border-box;
    }
    
    /* TABS INFERIORES: 3 por linha */
    .almox-tabs {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        border-bottom: none;
        margin-bottom: 16px;
        overflow-x: visible;
    }
    
    .almox-tabs .tab-btn {
        flex: 1 1 calc(33.333% - 8px);
        justify-content: center;
        text-align: center;
        padding: 10px 6px;
        font-size: 11px;
        white-space: normal;
        word-break: break-word;
        min-height: 48px;
        background: var(--almox-bg-card, #1e293b);
        border: 1px solid var(--almox-border, rgba(255,255,255,0.1));
        margin: 0;
    }
    
    .almox-tabs .tab-btn i {
        display: inline-block;
        margin-right: 5px;
        font-size: 12px;
    }
    
    .almox-tabs .tab-btn.active {
        border-bottom: 2px solid #10b981;
        background: rgba(16, 185, 129, 0.15);
    }
    
    .almox-kpis {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .kpi-card {
        padding: 14px;
    }
    
    .kpi-value {
        font-size: 24px;
    }
    
    .item-critico {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .item-critico-acao {
        width: 100%;
    }
    
    .item-critico-acao button {
        flex: 1;
    }
    
    .sugestao-compra {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px;
    }
    
    .sugestao-acoes {
        width: 100%;
    }
    
    .sugestao-acoes button {
        flex: 1;
    }
    
    .filtros-gestao,
    .compras-filtros,
    .rastreabilidade-filtros {
        flex-direction: column;
        width: 100%;
    }
    
    .filtros-gestao .form-control,
    .compras-filtros .form-control,
    .rastreabilidade-filtros .form-control {
        width: 100%;
        min-width: auto;
    }
    
    .filtros-gestao button,
    .compras-filtros button,
    .rastreabilidade-filtros button {
        width: 100%;
    }
    
    .gestao-table,
    .rastreabilidade-table,
    .matriz-table,
    .reservas-table {
        font-size: 11px;
    }
    
    .gestao-table th,
    .rastreabilidade-table th,
    .matriz-table th,
    .reservas-table th {
        padding: 10px 8px;
    }
    
    .gestao-table td,
    .rastreabilidade-table td,
    .matriz-table td,
    .reservas-table td {
        padding: 10px 8px;
    }
    
    .matriz-legenda {
        grid-template-columns: 1fr;
    }
    
    .modal-container {
        width: 95%;
        max-height: 85vh;
    }
    
    .modal-header h2, .modal-header h3 {
        font-size: 16px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer button {
        width: 100%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* Telas muito pequenas (< 480px) - TABS 2 por linha */
@media (max-width: 480px) {
    .almox-tabs .tab-btn {
        flex: 1 1 calc(50% - 8px);
        font-size: 10px;
        padding: 8px 4px;
        min-height: 44px;
    }
    .almox-tabs .tab-btn i {
        font-size: 10px;
    }
}

/* Telas extremamente pequenas (< 350px) - TABS 1 por linha */
@media (max-width: 350px) {
    .almox-tabs .tab-btn {
        flex: 1 1 100%;
    }
}

/* ========== TOUCH OTIMIZACOES ========== */
@media (hover: none) and (pointer: coarse) {
    .btn-primary:active,
    .btn-secondary:active,
    .tab-btn:active,
    .sugestao-acoes button:active,
    .btn-delete-item:active,
    .btn-adjust-stock:active {
        transform: scale(0.96);
        transition: transform 0.05s ease;
    }
    
    .kpi-card:hover,
    .sugestao-compra:hover {
        transform: none;
    }
    
    button, .tab-btn {
        min-height: 44px;
    }
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms;
        animation-iteration-count: 1;
        transition-duration: 0.01ms;
        scroll-behavior: auto;
    }
    
    .kpi-card,
    .sugestao-compra,
    .btn-primary,
    .btn-secondary {
        transition: none;
    }
    
    .kpi-card:hover,
    .sugestao-compra:hover {
        transform: none;
    }
}

/* ========== PRINT ========== */
@media print {
    .almox-actions,
    .almox-tabs,
    .filtros-gestao,
    .compras-filtros,
    .rastreabilidade-filtros,
    .modal-overlay,
    button:not(.no-print) {
        display: none;
    }
    
    .almox-header {
        border: 1px solid #ccc;
        background: white;
        color: black;
    }
    
    .gestao-tabela-container,
    .rastreabilidade-tabela,
    .matriz-container {
        overflow: visible;
    }
    
    .gestao-table,
    .rastreabilidade-table,
    .matriz-table {
        border-collapse: collapse;
        width: 100%;
    }
    
    .gestao-table th,
    .rastreabilidade-table th,
    .matriz-table th {
        background: #f0f0f0;
        color: black;
        border: 1px solid #ccc;
    }
    
    .gestao-table td,
    .rastreabilidade-table td,
    .matriz-table td {
        border: 1px solid #ccc;
        color: black;
    }
    
    .kpi-card {
        border: 1px solid #ccc;
        background: white;
        color: black;
    }
    
    .kpi-value {
        color: black;
    }
}

/* ========== ANIMACOES ADICIONAIS ========== */
@keyframes almoxPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse {
    animation: almoxPulse 2s infinite;
}

@keyframes almoxShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.shake {
    animation: almoxShake 0.3s ease;
}
