/* EM Inventários — Simulador de Painel
   Replica fiel do emi-saas.css + emi-core.css
   Prefixo: emi-sim- para não conflitar com o plugin principal
*/

.emi-sim-wrapper {
    max-width: 860px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #111827;
    line-height: 1.5;
}

/* ── Banner de demonstração ── */
.emi-sim-banner {
    background: #F5C712;
    color: #1a1a1a;
    text-align: center;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 10px;
    margin-bottom: 20px;
    letter-spacing: 0.2px;
}

/* ── Topbar ── */
.emi-sim-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid rgba(17,24,39,0.14);
    border-radius: 12px;
    background: #fff;
    margin-bottom: 12px;
}
.emi-sim-topbar-left {
    color: #111827;
    font-size: 16px;
    font-weight: 800;
}
.emi-sim-topbar-right { display: flex; gap: 8px; align-items: center; }
.emi-sim-creditos-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: #f3f3f3;
    color: #111827;
    font-size: 13px;
    border: 1px solid rgba(0,0,0,0.08);
    font-weight: 600;
}

/* ── Tabs ── */
.emi-sim-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 14px 0;
}
.emi-sim-tab {
    display: inline-block;
    padding: 9px 14px;
    border-radius: 10px;
    border: 1px solid rgba(17,24,39,0.18);
    background: #fff;
    color: #111827;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    line-height: 1;
}
.emi-sim-tab:hover { border-color: rgba(17,24,39,0.30); }
.emi-sim-tab.active {
    background: #044A29;
    color: #fff;
    border-color: rgba(0,0,0,0.05);
}

/* ── Conteúdo das tabs ── */
.emi-sim-tab-content { display: none; }
.emi-sim-tab-content.active { display: block; }

/* ── Cards ── */
.emi-sim-card {
    background: #fff;
    border: 1px solid rgba(17,24,39,0.14);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 14px;
}
.emi-sim-h2 {
    margin: 0 0 10px 0;
    color: #111827;
    font-size: 18px;
    font-weight: 800;
}
.emi-sim-muted { color: #5b5b5b; font-size: 13px; line-height: 1.45; }

/* ── Campos ── */
.emi-sim-field { margin: 10px 0 14px 0; }
.emi-sim-field > label {
    display: block;
    margin: 0 0 6px 0;
    color: #111827;
    font-weight: 700;
    font-size: 14px;
}
.emi-sim-req { color: #a60000; }
.emi-sim-input {
    width: 100%;
    max-width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(17,24,39,0.22);
    background: #fff;
    color: #111827;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.emi-sim-input:focus {
    outline: none;
    border-color: rgba(4,74,41,0.55);
    box-shadow: 0 0 0 3px rgba(4,74,41,0.10);
}
textarea.emi-sim-input { resize: vertical; min-height: 80px; }

/* ── Grid de instrumentos ── */
.emi-sim-checkgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
}
.emi-sim-check {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 10px;
    background: #fff;
    color: #111827;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    user-select: none;
}
.emi-sim-check:hover { border-color: rgba(4,74,41,0.30); background: #f7fbf9; }
.emi-sim-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #044A29;
    cursor: pointer;
    flex-shrink: 0;
}

/* ── Botão principal ── */
.emi-sim-btn-primary {
    display: inline-block;
    padding: 12px 24px;
    background: #044A29;
    color: #fff !important;
    border: none;
    border-radius: 10px;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-family: inherit;
    line-height: 1;
    text-align: center;
}
.emi-sim-btn-primary:hover { background: #033820; transform: translateY(-1px); }
.emi-sim-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ── Alerta inline ── */
.emi-sim-alert {
    border-radius: 12px;
    padding: 10px 14px;
    margin: 0 0 12px 0;
    font-size: 14px;
    border: 1px solid rgba(0,0,0,0.08);
}
.emi-sim-alert-success { border-color: rgba(46,125,50,0.3); background: rgba(46,125,50,0.07); color: #1a4d20; }
.emi-sim-alert-error   { border-color: rgba(198,40,40,0.3); background: rgba(198,40,40,0.07); color: #7a1010; }

/* ── Select filtro ── */
.emi-sim-select {
    padding: 8px 12px;
    border: 1px solid rgba(17,24,39,0.2);
    border-radius: 8px;
    background: #fff;
    color: #111827;
    font-size: 14px;
    max-width: 280px;
    width: 100%;
    font-family: inherit;
}

/* ── Tabela de grupos ── */
.emi-sim-tablewrap { overflow: auto; border-radius: 12px; border: 1px solid rgba(17,24,39,0.12); }
.emi-sim-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
.emi-sim-table th,
.emi-sim-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(17,24,39,0.08);
    text-align: left;
    color: #111827;
    vertical-align: top;
}
.emi-sim-table th { background: #f8fafc; font-weight: 700; }
.emi-sim-table tr:last-child td { border-bottom: none; }
.emi-sim-inst-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    background: rgba(46,125,50,0.12);
    border: 1px solid rgba(46,125,50,0.2);
    color: #1a4d20;
    margin: 2px 2px 2px 0;
    font-weight: 600;
}
.emi-sim-status-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: rgba(46,125,50,0.12);
    border: 1px solid rgba(46,125,50,0.18);
    color: #1a4d20;
    font-weight: 700;
}

/* ── Tab plano ── */
.emi-sim-plano-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    font-size: 14px;
    color: #111827;
}
.emi-sim-plano-row > span:first-child { font-weight: 600; }

/* ── Grid 3 colunas (tab início) ── */
.emi-sim-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}
.emi-sim-info-card {
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.08);
    background: #fafafa;
}
.emi-sim-info-title { font-weight: 700; color: #111827; margin-bottom: 6px; font-size: 14px; }
.emi-sim-info-desc  { color: #5b5b5b; font-size: 13px; line-height: 1.4; }

/* ── Spinner ── */
.emi-sim-spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: emi-sim-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes emi-sim-spin { to { transform: rotate(360deg); } }

/* ── Modal ── */
.emi-sim-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.emi-sim-modal-overlay.open { opacity: 1; pointer-events: all; }
.emi-sim-modal-box {
    background: #fff;
    border-radius: 12px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 12px 32px rgba(0,0,0,0.25);
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s;
}
.emi-sim-modal-overlay.open .emi-sim-modal-box { transform: scale(1); }
.emi-sim-modal-header { padding: 16px 18px; border-bottom: 1px solid rgba(0,0,0,0.08); }
.emi-sim-modal-title  { font-size: 16px; font-weight: 700; color: #111; margin: 0; }
.emi-sim-modal-body   { padding: 16px 18px; color: #222; font-size: 14px; }
.emi-sim-modal-warn {
    font-size: 13px; color: #555;
    background: #f7f7f7; border: 1px solid rgba(0,0,0,0.06);
    border-radius: 10px; padding: 10px 12px; margin-top: 10px;
}
.emi-sim-modal-actions {
    display: flex; gap: 10px; justify-content: flex-end;
    padding: 14px 18px; border-top: 1px solid rgba(0,0,0,0.08); background: #fafafa;
}
.emi-sim-modal-btn {
    border-radius: 10px; padding: 10px 16px;
    border: 1px solid rgba(0,0,0,0.15);
    cursor: pointer; font-weight: 600; font-size: 14px; font-family: inherit;
}
.emi-sim-modal-btn-sec { background: #fff; color: #111; }
.emi-sim-modal-btn-pri { background: #044A29; border-color: #044A29; color: #fff; }
.emi-sim-modal-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Toast ── */
.emi-sim-toast {
    position: fixed;
    bottom: 24px; right: 24px;
    background: #1a4d20; color: #fff;
    padding: 14px 20px; border-radius: 12px;
    font-size: 14px; font-weight: 600;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 9999999;
    transform: translateY(80px); opacity: 0;
    transition: all 0.35s cubic-bezier(0.34,1.56,0.64,1);
    max-width: 320px;
}
.emi-sim-toast.show { transform: translateY(0); opacity: 1; }

/* ── Responsivo ── */
@media (max-width: 600px) {
    .emi-sim-checkgrid { grid-template-columns: repeat(2, 1fr); }
    .emi-sim-table th:nth-child(3),
    .emi-sim-table td:nth-child(3) { display: none; } /* esconde coluna Código no mobile */
}
