/* ============================================================ */
/* VARIABLES & BASE                                             */
/* ============================================================ */
.entry-main {
    --surface: #ffffff;
    --surface-alt: #f8fafc;
    --bg: #f0f2f5;
    
    --oliva: #65a30d;
    --rose: #e11d48;
    --amber: #d97706;
    --blue: #3b82f6;
    
    --rose-soft: #fff1f2;
    --amber-soft: #fffbeb;
    --blue-soft: #eff6ff;
    --oliva-soft: #f7fee7;
    
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;

    background-color: var(--bg);
    min-height: 100vh;
    padding: 24px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
}

.entry-view {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ============================================================ */
/* HEADER & BREADCRUMB                                          */
/* ============================================================ */
.breadcrumb {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.breadcrumb a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 700;
}

.page-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 900;
    margin: 0;
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================================ */
/* KPI CARDS (Top Row)                                          */
/* ============================================================ */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.kpi-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.kpi-normal::before   { background: var(--oliva); }
.kpi-priority::before { background: var(--rose); }
.kpi-noinfo::before   { background: var(--amber); }
.kpi-total::before    { background: var(--blue); }

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.kpi-normal .kpi-icon   { background: var(--oliva-soft); color: var(--oliva); }
.kpi-priority .kpi-icon { background: var(--rose-soft); color: var(--rose); }
.kpi-noinfo .kpi-icon   { background: var(--amber-soft); color: var(--amber); }
.kpi-total .kpi-icon    { background: var(--blue-soft); color: var(--blue); }

.kpi-info {
    display: flex;
    flex-direction: column;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
}

.kpi-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* ============================================================ */
/* MAIN CONTENT GRID                                            */
/* ============================================================ */
.main-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 20px;
    align-items: start;
}

/* ============================================================ */
/* SCANNER SECTION (Left)                                       */
/* ============================================================ */
.scanner-card {
    background: var(--surface);
    border-radius: 20px;
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.scanner-header {
    margin-bottom: 20px;
}

.scanner-title {
    font-size: 1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.scanner-input-group {
    position: relative;
    margin-bottom: 24px;
}

.scanner-input {
    width: 100%;
    height: 60px;
    background: var(--surface-alt);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 0 16px 0 50px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.scanner-input:focus {
    outline: none;
    background: #fff;
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.scanner-icon-abs {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.4rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

.scanner-input:focus + .scanner-icon-abs {
    color: var(--blue);
}

/* ---- Ultimo Escaneo Panel ---- */
.last-scan-panel {
    background: var(--surface-alt);
    border-radius: 12px;
    padding: 16px;
    border: 1px dashed var(--border);
    animation: slideUp 0.3s ease-out;
}

.last-scan-title {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: block;
}

.last-scan-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.last-scan-main {
    display: flex;
    gap: 12px;
    align-items: center;
}

.last-scan-thumb {
    width: 50px;
    height: 50px;
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: 1px solid var(--border);
}

.last-scan-info {
    flex: 1;
}

.last-scan-code {
    font-family: monospace;
    font-weight: 800;
    font-size: 0.95rem;
    display: block;
}

.last-scan-product {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.2;
}

.last-scan-flow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.last-scan-badge {
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 20px;
}

/* ============================================================ */
/* LOGS SECTION (Right)                                         */
/* ============================================================ */
.logs-card {
    background: var(--surface);
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    overflow: hidden;
}

.logs-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface-alt);
}

.tabs {
    display: flex;
    gap: 8px;
}

.tab {
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.tab:hover {
    background: rgba(0,0,0,0.03);
    color: var(--text-main);
}

.tab.active {
    background: var(--surface);
    color: var(--blue);
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.table-scroll {
    max-height: 600px;
    overflow-y: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    padding: 12px 24px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--text-muted);
    text-align: left;
    background: var(--surface-alt);
    position: sticky;
    top: 0;
    z-index: 10;
}

.table td {
    padding: 14px 24px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--surface-alt);
}

.table tr:hover td {
    background: #fafafa;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ---- Custom Row Colors ---- */
.row-priority { background-color: var(--rose-soft) !important; }
.row-priority:hover td { background-color: #ffe4e6 !important; }

.row-noinfo { background-color: var(--amber-soft) !important; }
.row-noinfo:hover td { background-color: #fef3c7 !important; }

/* ---- Badges ---- */
.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.badge-priority { background: var(--rose); color: #fff; }
.badge-normal   { background: var(--oliva); color: #fff; }
.badge-noinfo   { background: var(--amber); color: #fff; }
.badge-neutral  { background: #e2e8f0; color: #475569; }

/* ============================================================ */
/* ANIMATIONS                                                   */
/* ============================================================ */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-blue {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

.scanning-pulse {
    animation: pulse-blue 2s infinite;
}

/* ============================================================ */
/* RESPONSIVE                                                   */
/* ============================================================ */
@media (max-width: 1200px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
    
    .scanner-card {
        max-width: 500px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .kpi-row {
        grid-template-columns: 1fr 1fr;
    }
    
    .page-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

