/* Sir Neko Envasado — frontend */
[x-cloak] { display: none !important; }

.senv-app {
    max-width: 980px;
    margin: 0 auto;
    padding: 24px 16px;
    font-family: 'Josefin Sans', system-ui, sans-serif;
    color: #1a1a1a;
}

.senv-gate {
    max-width: 520px;
    margin: 40px auto;
    padding: 24px;
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-align: center;
}

.senv-header h1 {
    font-size: 28px;
    margin: 0 0 4px;
    letter-spacing: 0.5px;
}
.senv-sub {
    color: #666;
    font-size: 14px;
    margin: 0 0 20px;
}

/* Búsqueda */
.senv-search label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    color: #333;
}
.senv-search-wrap {
    position: relative;
}
.senv-search input[type="text"] {
    width: 100%;
    height: 48px;
    padding: 0 44px 0 14px;
    border: 2px solid #bbb;
    border-radius: 10px;
    font-size: 15px;
    background: #fff;
    box-sizing: border-box;
}
.senv-search input[type="text"]:focus {
    border-color: #1a1a1a;
    outline: none;
}
.senv-spinner {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 18px;
}

.senv-search-results {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}
.senv-search-results li {
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.senv-search-results li:last-child { border-bottom: 0; }
.senv-search-results li:hover { background: #f5f5f5; }
.senv-search-results small { color: #888; font-size: 12px; }

.senv-empty {
    color: #888;
    font-size: 14px;
    margin-top: 10px;
}

/* Producto */
.senv-producto-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #eee;
}
.senv-producto-header h2 {
    margin: 0 0 4px;
    font-size: 22px;
}
.senv-regla-chip {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-radius: 10px;
    background: #eee;
    color: #666;
    vertical-align: middle;
}
.senv-regla-chip.senv-regla-cat {
    background: #e8f5e9;
    color: #2e7d32;
}

/* Stock summary cards */
.senv-stock-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}
.senv-stock-card {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 12px 14px;
}
.senv-stock-card.senv-stock-ok    { border-color: #c8e6c9; background: #f1f8e9; }
.senv-stock-card.senv-stock-warn  { border-color: #ffe0b2; background: #fff8e1; }
.senv-stock-card.senv-stock-bad   { border-color: #ffcdd2; background: #ffebee; }
.senv-stock-card.senv-stock-info  { border-color: #bbdefb; background: #e3f2fd; }
.senv-stock-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 4px;
}
.senv-stock-num {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 2px;
}
.senv-stock-card small {
    color: #888;
    font-size: 11px;
}

/* Tabla */
.senv-tabla-wrap {
    overflow-x: auto;
    margin-bottom: 24px;
}
.senv-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.senv-tabla th, .senv-tabla td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}
.senv-tabla th {
    background: #fafafa;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-size: 12px;
    color: #555;
}
.senv-tabla input[type="number"] {
    width: 90px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #bbb;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}
.senv-tabla input[type="number"]:disabled {
    background: #f5f5f5;
    color: #aaa;
    cursor: not-allowed;
}

.senv-row-inactiva td {
    color: #bbb;
    text-decoration: line-through;
    background: #fafafa;
}
.senv-row-sinregla td {
    color: #aaa;
    background: #fbfbfb;
}
.senv-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    background: #eee;
    color: #888;
    border-radius: 10px;
    font-size: 11px;
    text-decoration: none;
}
.senv-badge-warn { background: #fff3e0; color: #b26a00; }

.senv-target-cell { color: #555; font-size: 13px; }

.senv-overflow-tag,
.senv-topeada-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    background: #fff3e0;
    color: #b26a00;
    border-radius: 8px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
}
.senv-topeada-tag {
    background: #e3f2fd;
    color: #0d47a1;
}

.senv-tope-tag {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    color: #777;
    letter-spacing: 0.3px;
}

.senv-diff-pos { color: #2e7d32; font-weight: 600; }
.senv-diff-neg { color: #c62828; font-weight: 600; }

.senv-envasar-cell { text-align: right; }
.senv-envasar-num {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    display: block;
}
.senv-envasar-cell small {
    color: #666;
    font-size: 12px;
}

/* Calc */
.senv-calc {
    margin-bottom: 24px;
    padding: 16px;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 10px;
}
.senv-calc label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
    color: #333;
}
.senv-calc-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
    flex-wrap: wrap;
}
.senv-calc-row input {
    flex: 0 0 180px;
    height: 44px;
    padding: 0 12px;
    border: 2px solid #bbb;
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
}

.senv-btn, .senv-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 44px;
    padding: 0 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    box-sizing: border-box;
    text-decoration: none;
    line-height: 1;
}
.senv-btn {
    background: #1a1a1a;
    color: #fff;
    border: 2px solid #1a1a1a;
}
.senv-btn:hover:not(:disabled) { background: #2e7d32; border-color: #2e7d32; }
.senv-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.senv-btn-ghost {
    background: transparent;
    color: #1a1a1a;
    border: 2px solid #1a1a1a;
}
.senv-btn-ghost:hover { background: #1a1a1a; color: #fff; }

.senv-error {
    margin: 10px 0 0;
    color: #c62828;
    font-size: 14px;
}

.senv-bolson-hint {
    margin: 8px 0 0;
    font-size: 13px;
    color: #555;
}
.senv-bolson-hint a {
    color: #2e7d32;
    text-decoration: underline;
    margin-left: 4px;
}
.senv-bolson-hint strong { color: #1a1a1a; }

/* Resultado */
.senv-resultado {
    background: #fff;
    border: 2px solid #2e7d32;
    border-radius: 10px;
    padding: 18px;
}
.senv-resultado h3 {
    margin: 0 0 14px;
    font-size: 18px;
    color: #2e7d32;
}
.senv-totales {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.senv-totales li {
    background: #f9f9f9;
    padding: 10px 14px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.senv-totales span { color: #666; font-size: 13px; }
.senv-totales strong { font-size: 18px; color: #1a1a1a; }
.senv-totales .senv-warn-li {
    grid-column: 1 / -1;
    background: #fff3e0;
    color: #c65100;
}
.senv-totales .senv-warn-li span { color: #c65100; }

.senv-warnings {
    margin-top: 14px;
    padding: 12px 14px;
    background: #fff3e0;
    border-radius: 8px;
    color: #7f4a00;
}
.senv-warnings h4 {
    margin: 0 0 6px;
    font-size: 14px;
    color: #c65100;
}
.senv-warnings ul {
    margin: 0;
    padding-left: 20px;
}
.senv-warnings li {
    font-size: 13px;
    margin-bottom: 4px;
}

@media (max-width: 600px) {
    .senv-producto-header { flex-direction: column; }
    .senv-calc-row input { flex: 1 1 100%; }
}
